diff options
author | Laurențiu Nicola <[email protected]> | 2020-04-24 19:48:30 +0100 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2020-04-25 10:19:23 +0100 |
commit | 58dde891f87bc6131b0ef34c33f6ffb9aa0c0ec3 (patch) | |
tree | 7cd3fc2771319eb78a3487c5f64e5f487e047698 /crates/ra_hir_expand | |
parent | 5d97667f8dd467e7382885fcae40bcdbac63ae4f (diff) |
Avoid lossy OsString conversions
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 3da137f2e..493cda2c4 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs | |||
@@ -358,7 +358,7 @@ fn env_expand( | |||
358 | // However, we cannot use an empty string here, because for | 358 | // However, we cannot use an empty string here, because for |
359 | // `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become | 359 | // `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become |
360 | // `include!("foo.rs"), which might go to infinite loop | 360 | // `include!("foo.rs"), which might go to infinite loop |
361 | let s = get_env_inner(db, arg_id, &key).unwrap_or("__RA_UNIMPLEMENTATED__".to_string()); | 361 | let s = get_env_inner(db, arg_id, &key).unwrap_or_else(|| "__RA_UNIMPLEMENTATED__".to_string()); |
362 | let expanded = quote! { #s }; | 362 | let expanded = quote! { #s }; |
363 | 363 | ||
364 | Ok((expanded, FragmentKind::Expr)) | 364 | Ok((expanded, FragmentKind::Expr)) |