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]>
bors[bot] 2020-03-26
parent d19a5a3 · parent 9cca8e2 · commit be44120
-rw-r--r--lib/text-size/src/size.rs2
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()
}