-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a couple of non-canonical ctors #5
Conversation
src/range.rs
Outdated
} | ||
|
||
/// Creates a `TextRange` with specified starting offset and length. | ||
pub fn offset_len(start: TextSize, length: TextSize) -> TextRange { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not terribly happy about the naming here, but I do thing that we need a ctor with this signature. Doing TextRange(start, start + len)
on the callsite doesn't work if start
is a non-trivial expression.
Per discussion in #2, the construction patterns we want to make easy (but I'm up to changing these targets):
The currently implemented ways on master to achieve this:
( With this PR, we have:
Counter proposal 1 –
Counter proposal 2 –
Counter proposal 3 – factory style length replacement
I think |
I do feel that
I now think that, with |
Hm, I am starting to think that maybe |
|
Are you talking about my |
On a previous branch, I had it as |
I am more concerned not with the naming, but with the fact that the argument should be a |
No description provided.