]> git.lizzy.rs Git - rust.git/commitdiff
Update condition check code style
authorJay Somedon <jay.somedon@outlook.com>
Wed, 23 Dec 2020 14:19:27 +0000 (22:19 +0800)
committerEdwin Cheng <edwin0cheng@gmail.com>
Thu, 4 Mar 2021 01:11:43 +0000 (09:11 +0800)
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
crates/proc_macro_api/src/lib.rs

index 34a4e68ab788fdbbd880fa6f318cd4f2daa1747f..481fb6deeada196d643866a2db37be89c899e174 100644 (file)
@@ -155,7 +155,7 @@ fn read_version(&self, dylib_path: &Path) -> io::Result<String> {
         let header = &dot_rustc[..8];
         const EXPECTED_HEADER: [u8; 8] = [b'r', b'u', b's', b't', 0, 0, 0, 5];
         // check if header is valid
-        if !(header == EXPECTED_HEADER) {
+        if header != EXPECTED_HEADER {
             return Err(io::Error::new(io::ErrorKind::InvalidData, format!(".rustc section should start with header {:?}; header {:?} is actually presented.",EXPECTED_HEADER ,header)));
         }