about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/rust-analyzer/crates/ide/src/inlay_hints/adjustment.rs14
-rw-r--r--src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/adjustment.rs b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/adjustment.rs
index e3743daec49..f5960c12568 100644
--- a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/adjustment.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/adjustment.rs
@@ -161,37 +161,37 @@ pub(super) fn hints(
                     PointerCast::ReifyFnPointer => (
                         "<fn-item-to-fn-pointer>",
                         "fn item to fn pointer",
-                        "Converts a named function to a function pointer `fn()`. Useful when passing functions as values."
+                        "Converts a named function to a function pointer `fn()`. Useful when passing functions as values.",
                     ),
                     PointerCast::UnsafeFnPointer => (
                         "<safe-fn-pointer-to-unsafe-fn-pointer>",
                         "safe fn pointer to unsafe fn pointer",
-                        "Coerces a safe function pointer to an unsafe one. Allows calling it in an unsafe context."
+                        "Coerces a safe function pointer to an unsafe one. Allows calling it in an unsafe context.",
                     ),
                     PointerCast::ClosureFnPointer(Safety::Unsafe) => (
                         "<closure-to-unsafe-fn-pointer>",
                         "closure to unsafe fn pointer",
-                        "Converts a non-capturing closure to an unsafe function pointer. Required for use in `extern` or unsafe APIs."
+                        "Converts a non-capturing closure to an unsafe function pointer. Required for use in `extern` or unsafe APIs.",
                     ),
                     PointerCast::ClosureFnPointer(Safety::Safe) => (
                         "<closure-to-fn-pointer>",
                         "closure to fn pointer",
-                        "Converts a non-capturing closure to a function pointer. Lets closures behave like plain functions."
+                        "Converts a non-capturing closure to a function pointer. Lets closures behave like plain functions.",
                     ),
                     PointerCast::MutToConstPointer => (
                         "<mut-ptr-to-const-ptr>",
                         "mut ptr to const ptr",
-                        "Coerces `*mut T` to `*const T`. Safe because const pointers restrict what you can do."
+                        "Coerces `*mut T` to `*const T`. Safe because const pointers restrict what you can do.",
                     ),
                     PointerCast::ArrayToPointer => (
                         "<array-ptr-to-element-ptr>",
                         "array to pointer",
-                        "Converts an array to a pointer to its first element. Similar to how arrays decay to pointers in C."
+                        "Converts an array to a pointer to its first element. Similar to how arrays decay to pointers in C.",
                     ),
                     PointerCast::Unsize => (
                         "<unsize>",
                         "unsize coercion",
-                        "Converts a sized type to an unsized one. Used for things like turning arrays into slices or concrete types into trait objects."
+                        "Converts a sized type to an unsized one. Used for things like turning arrays into slices or concrete types into trait objects.",
                     ),
                 }
             }
diff --git a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
index b2ee254701f..4d7650f9e13 100644
--- a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
@@ -172,12 +172,12 @@ fn format_function_hint(func: &ast::Fn, max_length: usize) -> Option<String> {
                 format!("_: {}", ty)
             } else {
                 let param_source = param.syntax().text().to_string();
-                if param_source.trim() == "..." { "...".to_string() } else { "_".to_string() }
+                if param_source.trim() == "..." { "...".to_owned() } else { "_".to_owned() }
             };
 
             let param_len = param_text.len() + if param_parts.is_empty() { 0 } else { 2 };
             if total_len + param_len > max_param_len {
-                param_parts.push("...".to_string());
+                param_parts.push("...".to_owned());
                 break;
             }
 
@@ -186,12 +186,12 @@ fn format_function_hint(func: &ast::Fn, max_length: usize) -> Option<String> {
         }
 
         if param_parts.is_empty() {
-            "()".to_string()
+            "()".to_owned()
         } else {
             format!("({})", param_parts.join(", "))
         }
     } else {
-        "()".to_string()
+        "()".to_owned()
     };
 
     Some(format!("fn {}{}", name_str, params))