Skip to content

Commit b89a403

Browse files
proc-macro-api: Fix warnings about clippy str_to_string rule
1 parent 5d1f283 commit b89a403

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

crates/proc-macro-api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl ProcMacro {
197197
&deserialize_span_data_index_map(&resp.span_data_table),
198198
)
199199
})),
200-
_ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
200+
_ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
201201
}
202202
}
203203
}

crates/proc-macro-api/src/msg/flat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ impl<'a, 'span, S: InternableSpan> Writer<'a, 'span, S> {
419419
let table = &mut self.text;
420420
*self.string_table.entry(text).or_insert_with(|| {
421421
let idx = table.len();
422-
table.push(text.to_string());
422+
table.push(text.to_owned());
423423
idx as u32
424424
})
425425
}

crates/proc-macro-api/src/process.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl ProcMacroProcessSrv {
7878

7979
match response {
8080
Response::ApiVersionCheck(version) => Ok(version),
81-
_ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
81+
_ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
8282
}
8383
}
8484

@@ -90,7 +90,7 @@ impl ProcMacroProcessSrv {
9090

9191
match response {
9292
Response::SetConfig(crate::msg::ServerConfig { span_mode }) => Ok(span_mode),
93-
_ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
93+
_ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
9494
}
9595
}
9696

@@ -104,7 +104,7 @@ impl ProcMacroProcessSrv {
104104

105105
match response {
106106
Response::ListMacros(it) => Ok(it),
107-
_ => Err(ServerError { message: "unexpected response".to_string(), io: None }),
107+
_ => Err(ServerError { message: "unexpected response".to_owned(), io: None }),
108108
}
109109
}
110110

crates/proc-macro-api/src/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub fn read_dylib_info(dylib_path: &AbsPath) -> io::Result<RustCInfo> {
3838
let version_part = items.next().ok_or_else(|| err!("no version string"))?;
3939
let mut version_parts = version_part.split('-');
4040
let version = version_parts.next().ok_or_else(|| err!("no version"))?;
41-
let channel = version_parts.next().unwrap_or_default().to_string();
41+
let channel = version_parts.next().unwrap_or_default().to_owned();
4242

4343
let commit = match items.next() {
4444
Some(commit) => {

0 commit comments

Comments
 (0)