mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Avoid lossy OsString conversions
This commit is contained in:
parent
5d97667f8d
commit
58dde891f8
5 changed files with 14 additions and 9 deletions
|
@ -358,7 +358,7 @@ fn env_expand(
|
|||
// However, we cannot use an empty string here, because for
|
||||
// `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become
|
||||
// `include!("foo.rs"), which might go to infinite loop
|
||||
let s = get_env_inner(db, arg_id, &key).unwrap_or("__RA_UNIMPLEMENTATED__".to_string());
|
||||
let s = get_env_inner(db, arg_id, &key).unwrap_or_else(|| "__RA_UNIMPLEMENTATED__".to_string());
|
||||
let expanded = quote! { #s };
|
||||
|
||||
Ok((expanded, FragmentKind::Expr))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue