Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add TextRange: TryFrom<Range<T>> impl #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add TextRange: TryFrom<Range<T>> impl #53

wants to merge 1 commit into from

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented May 18, 2024

No description provided.

Ok(TextRange::new(
value.start.try_into()?,
value.end.try_into()?,
))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check that start <= end?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would require me to rethink the error type and I didn't want to bother with that 😬 I guess discarding the TryInto<TextSize> error and replacing it with a generic one here would be probably fine

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants