mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Merge #4125
4125: Avoid lossy OsString conversions r=matklad a=lnicola This is a bit invasive, and perhaps for not much benefit since non-UTF-8 environment variables don't work anyway. Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
f654f49435
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