Skip to content
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

textinput.rs replace_selection now slices wrt bytes rather than chars #20208

Closed
wants to merge 6 commits into from

cleaning up

  • Loading branch information
sarkhanbayramli committed Mar 12, 2018
commit 90e7f7262c40ace79c1e22b4959457b9bd4e3adf
@@ -159,9 +159,8 @@ fn len_of_first_n_chars(text: &str, n: usize) -> usize {
/// The length in bytes of the first n code units a string when encoded in UTF-16.
///
/// If the string is fewer than n code units, returns the length of the whole string.


fn len_of_first_n_code_units(text: &str, n: usize) -> Option<usize> {//usize {
/// Return `None` if `n` would split a non-BMP code point.
fn len_of_first_n_code_units(text: &str, n: usize) -> Option<usize> {
if n == 0 {
return Some(0);
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.