proc-macro-api: Fix warnings about clippy str_to_string rule

This commit is contained in:
Tetsuharu Ohzeki 2024-02-10 00:38:39 +09:00
parent 5d1f2835af
commit b89a4038c9
4 changed files with 6 additions and 6 deletions

View file

@ -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 }),
}
}
}

View file

@ -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
})
}

View file

@ -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 }),
}
}

View file

@ -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) => {