Unnamed repository; edit this file 'description' to name the repository.
Merge rust-analyzer/text-size#31
31: Use standard generics for TextSize::of r=CAD97 a=CAD97
There is no specific reason to use APIT here, so prefer the form that allows more control for the user, in the form of the turbofish.
Co-authored-by: CAD97 <[email protected]>
| -rw-r--r-- | lib/text-size/src/size.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/text-size/src/size.rs b/lib/text-size/src/size.rs index e20763f4bc..171f337777 100644 --- a/lib/text-size/src/size.rs +++ b/lib/text-size/src/size.rs @@ -57,7 +57,7 @@ impl TextSize { /// assert_eq!(str_size, TextSize::from(13)); /// ``` #[inline] - pub fn of(text: impl LenTextSize) -> TextSize { + pub fn of<T: LenTextSize>(text: T) -> TextSize { text.len_text_size() } |