diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-22 17:42:04 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-22 17:42:47 -0500 |
| commit | a06baa56b95674fc626b3c3fd680d6a65357fe60 (patch) | |
| tree | cd9d867c2ca3cff5c1d6b3bd73377c44649fb075 /src/librustc_data_structures/const_cstr.rs | |
| parent | 8eb7c58dbb7b32701af113bc58722d0d1fefb1eb (diff) | |
| download | rust-a06baa56b95674fc626b3c3fd680d6a65357fe60.tar.gz rust-a06baa56b95674fc626b3c3fd680d6a65357fe60.zip | |
Format the world
Diffstat (limited to 'src/librustc_data_structures/const_cstr.rs')
| -rw-r--r-- | src/librustc_data_structures/const_cstr.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librustc_data_structures/const_cstr.rs b/src/librustc_data_structures/const_cstr.rs index fbe2f29f706..1ebcb87818e 100644 --- a/src/librustc_data_structures/const_cstr.rs +++ b/src/librustc_data_structures/const_cstr.rs @@ -16,7 +16,7 @@ /// builds. #[macro_export] macro_rules! const_cstr { - ($s:expr) => ({ + ($s:expr) => {{ use std::ffi::CStr; let str_plus_nul = concat!($s, "\0"); @@ -24,9 +24,7 @@ macro_rules! const_cstr { if cfg!(debug_assertions) { CStr::from_bytes_with_nul(str_plus_nul.as_bytes()).unwrap() } else { - unsafe { - CStr::from_bytes_with_nul_unchecked(str_plus_nul.as_bytes()) - } + unsafe { CStr::from_bytes_with_nul_unchecked(str_plus_nul.as_bytes()) } } - }) + }}; } |
