about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>2024-02-10 00:38:39 +0900
committerTetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>2024-02-10 01:00:40 +0900
commitb89a4038c9212b08bed11db2f3915218fcfe4cc0 (patch)
tree7dd94c1232c244cf7c6f53664cbcf5408ba70f07
parent5d1f2835af1e9dc67c1a0b72ccb0c0ccf9a413b4 (diff)
downloadrust-b89a4038c9212b08bed11db2f3915218fcfe4cc0.tar.gz
rust-b89a4038c9212b08bed11db2f3915218fcfe4cc0.zip
proc-macro-api: Fix warnings about clippy `str_to_string` rule
-rw-r--r--crates/proc-macro-api/src/lib.rs2
-rw-r--r--crates/proc-macro-api/src/msg/flat.rs2
-rw-r--r--crates/proc-macro-api/src/process.rs6
-rw-r--r--crates/proc-macro-api/src/version.rs2
4 files changed, 6 insertions, 6 deletions
diff --git a/crates/proc-macro-api/src/lib.rs b/crates/proc-macro-api/src/lib.rs
index 379d184dd68..1dadfc40ac4 100644
--- a/crates/proc-macro-api/src/lib.rs
+++ b/crates/proc-macro-api/src/lib.rs
@@ -197,7 +197,7 @@ impl ProcMacro {
                     &deserialize_span_data_index_map(&resp.span_data_table),
                 )
             })),
-            _ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
+            _ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
         }
     }
 }
diff --git a/crates/proc-macro-api/src/msg/flat.rs b/crates/proc-macro-api/src/msg/flat.rs
index d4fdd5bde13..caf9e237fdd 100644
--- a/crates/proc-macro-api/src/msg/flat.rs
+++ b/crates/proc-macro-api/src/msg/flat.rs
@@ -419,7 +419,7 @@ impl<'a, 'span, S: InternableSpan> Writer<'a, 'span, S> {
         let table = &mut self.text;
         *self.string_table.entry(text).or_insert_with(|| {
             let idx = table.len();
-            table.push(text.to_string());
+            table.push(text.to_owned());
             idx as u32
         })
     }
diff --git a/crates/proc-macro-api/src/process.rs b/crates/proc-macro-api/src/process.rs
index 5ce601bce69..96f97bf5e20 100644
--- a/crates/proc-macro-api/src/process.rs
+++ b/crates/proc-macro-api/src/process.rs
@@ -78,7 +78,7 @@ impl ProcMacroProcessSrv {
 
         match response {
             Response::ApiVersionCheck(version) => Ok(version),
-            _ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
+            _ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
         }
     }
 
@@ -90,7 +90,7 @@ impl ProcMacroProcessSrv {
 
         match response {
             Response::SetConfig(crate::msg::ServerConfig { span_mode }) => Ok(span_mode),
-            _ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
+            _ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
         }
     }
 
@@ -104,7 +104,7 @@ impl ProcMacroProcessSrv {
 
         match response {
             Response::ListMacros(it) => Ok(it),
-            _ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
+            _ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
         }
     }
 
diff --git a/crates/proc-macro-api/src/version.rs b/crates/proc-macro-api/src/version.rs
index 5f81c0a96d9..f768de3e31d 100644
--- a/crates/proc-macro-api/src/version.rs
+++ b/crates/proc-macro-api/src/version.rs
@@ -38,7 +38,7 @@ pub fn read_dylib_info(dylib_path: &AbsPath) -> io::Result<RustCInfo> {
     let version_part = items.next().ok_or_else(|| err!("no version string"))?;
     let mut version_parts = version_part.split('-');
     let version = version_parts.next().ok_or_else(|| err!("no version"))?;
-    let channel = version_parts.next().unwrap_or_default().to_string();
+    let channel = version_parts.next().unwrap_or_default().to_owned();
 
     let commit = match items.next() {
         Some(commit) => {