Commit 1997f539 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

sim: Remove extraneous static

According to clippy, `&'static` can just be `&` for static definitions,
which always have a static lifetime.  Clean this up in the arrays in the
code, as well as generation code in imgtool.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 91de33d9
Loading
Loading
Loading
Loading
+1 −1
Changes for scripts/imgtool/keys/general.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ class KeyClass(object):

    def emit_rust_public(self, file=sys.stdout):
        self._emit(
                header="static {}_PUB_KEY: &'static [u8] = &[".format(self.shortname().upper()),
                header="static {}_PUB_KEY: &[u8] = &[".format(self.shortname().upper()),
                trailer="];",
                encoded_bytes=self.get_public_bytes(),
                indent="    ",
+0 −1
Changes for sim/mcuboot-sys/src/c.rs: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@

use crate::area::AreaDesc;
use simflash::SimMultiFlash;
use libc;
use crate::api;

/// Invoke the bootloader on this flash device.
+1 −1
Changes for sim/src/ecdsa_pub_key-rs.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
static ECDSA256_PUB_KEY: &'static [u8] = &[
static ECDSA256_PUB_KEY: &[u8] = &[
    0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
    0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
    0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
+1 −1
Changes for sim/src/ed25519_pub_key-rs.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
static ED25519_PUB_KEY: &'static [u8] = &[
static ED25519_PUB_KEY: &[u8] = &[
    0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65,
    0x70, 0x03, 0x21, 0x00, 0xd4, 0xb3, 0x1b, 0xa4,
    0x9a, 0x3a, 0xdd, 0x3f, 0x82, 0x5d, 0x10, 0xca,
+2 −2
Changes for sim/src/lib.rs: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ pub use crate::{
    },
};

const USAGE: &'static str = "
const USAGE: &str = "
Mcuboot simulator

Usage:
@@ -67,7 +67,7 @@ pub enum DeviceName {
    Nrf52840UnequalSlots,
}

pub static ALL_DEVICES: &'static [DeviceName] = &[
pub static ALL_DEVICES: &[DeviceName] = &[
    DeviceName::Stm32f4,
    DeviceName::K64f,
    DeviceName::K64fBig,
Loading