]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_data_structures/const_cstr.rs
[self-profiler] Add example to `-Z help` to turn on query key recording
[rust.git] / src / librustc_data_structures / const_cstr.rs
index 4589d973b6a41433455a789286c66f01fa020e2f..1ebcb87818ecf3b53b0e4911caaccda2cac30575 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 /// This macro creates a zero-overhead &CStr by adding a NUL terminator to
 /// the string literal passed into it at compile-time. Use it like:
 ///
@@ -26,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");
@@ -34,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()) }
         }
-    })
+    }};
 }