Commit c20bbb22 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

sim: Remove useless `return`s

Apply clippy suggestions to directly result in values instead of
returning those values at the end of a function.  Better matches common
Rust style.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 8608c53f
Loading
Loading
Loading
Loading
+2 −2
Changes for sim/mcuboot-sys/src/c.rs: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ pub fn rsa_oaep_encrypt(pubkey: &[u8], seckey: &[u8]) -> Result<[u8; 256], &'sta
                                  encbuf.as_mut_ptr()) == 0 {
            return Ok(encbuf);
        }
        return Err("Failed to encrypt buffer");
        Err("Failed to encrypt buffer")
    }
}

@@ -73,7 +73,7 @@ pub fn kw_encrypt(kek: &[u8], seckey: &[u8]) -> Result<[u8; 24], &'static str> {
        if raw::kw_encrypt_(kek.as_ptr(), seckey.as_ptr(), encbuf.as_mut_ptr()) == 0 {
            return Ok(encbuf);
        }
        return Err("Failed to encrypt buffer");
        Err("Failed to encrypt buffer")
    }
}

+1 −1
Changes for sim/simflash/src/lib.rs: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ impl SimFlash {
            }
            offset -= size;
        }
        return None;
        None
    }

}