Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/text-size/src/traits.rs')
| -rw-r--r-- | lib/text-size/src/traits.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/text-size/src/traits.rs b/lib/text-size/src/traits.rs index ca4b7d9b42..8d197db8c1 100644 --- a/lib/text-size/src/traits.rs +++ b/lib/text-size/src/traits.rs @@ -7,6 +7,7 @@ pub trait TextSized: Copy { } impl TextSized for &'_ str { + #[inline] fn text_size(self) -> TextSize { self.len() .try_into() @@ -15,6 +16,7 @@ impl TextSized for &'_ str { } impl TextSized for char { + #[inline] fn text_size(self) -> TextSize { TextSize(self.len_utf8() as u32) } |