mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
load-cargo: Fix warnings about clippy str_to_string
rule
This commit is contained in:
parent
ae78dcae75
commit
80713250c5
1 changed files with 2 additions and 2 deletions
|
@ -279,7 +279,7 @@ pub fn load_proc_macro(
|
||||||
let dylib = MacroDylib::new(path.to_path_buf());
|
let dylib = MacroDylib::new(path.to_path_buf());
|
||||||
let vec = server.load_dylib(dylib).map_err(|e| format!("{e}"))?;
|
let vec = server.load_dylib(dylib).map_err(|e| format!("{e}"))?;
|
||||||
if vec.is_empty() {
|
if vec.is_empty() {
|
||||||
return Err("proc macro library returned no proc macros".to_string());
|
return Err("proc macro library returned no proc macros".to_owned());
|
||||||
}
|
}
|
||||||
Ok(vec
|
Ok(vec
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -382,7 +382,7 @@ impl ProcMacroExpander for Expander {
|
||||||
call_site: Span,
|
call_site: Span,
|
||||||
mixed_site: Span,
|
mixed_site: Span,
|
||||||
) -> Result<tt::Subtree<Span>, ProcMacroExpansionError> {
|
) -> Result<tt::Subtree<Span>, ProcMacroExpansionError> {
|
||||||
let env = env.iter().map(|(k, v)| (k.to_string(), v.to_string())).collect();
|
let env = env.iter().map(|(k, v)| (k.to_owned(), v.to_owned())).collect();
|
||||||
match self.0.expand(subtree, attrs, env, def_site, call_site, mixed_site) {
|
match self.0.expand(subtree, attrs, env, def_site, call_site, mixed_site) {
|
||||||
Ok(Ok(subtree)) => Ok(subtree),
|
Ok(Ok(subtree)) => Ok(subtree),
|
||||||
Ok(Err(err)) => Err(ProcMacroExpansionError::Panic(err.0)),
|
Ok(Err(err)) => Err(ProcMacroExpansionError::Panic(err.0)),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue