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: David Brown <david.brown@linaro.org>
diff --git a/scripts/imgtool/keys/general.py b/scripts/imgtool/keys/general.py
index e8755f6..8e3c65b 100644
--- a/scripts/imgtool/keys/general.py
+++ b/scripts/imgtool/keys/general.py
@@ -31,7 +31,7 @@
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=" ",
diff --git a/sim/mcuboot-sys/src/c.rs b/sim/mcuboot-sys/src/c.rs
index 61276e2..b168973 100644
--- a/sim/mcuboot-sys/src/c.rs
+++ b/sim/mcuboot-sys/src/c.rs
@@ -8,7 +8,6 @@
use crate::area::AreaDesc;
use simflash::SimMultiFlash;
-use libc;
use crate::api;
/// Invoke the bootloader on this flash device.
diff --git a/sim/src/ecdsa_pub_key-rs.txt b/sim/src/ecdsa_pub_key-rs.txt
index b63f6b0..e3a0cc1 100644
--- a/sim/src/ecdsa_pub_key-rs.txt
+++ b/sim/src/ecdsa_pub_key-rs.txt
@@ -1,4 +1,4 @@
-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,
diff --git a/sim/src/ed25519_pub_key-rs.txt b/sim/src/ed25519_pub_key-rs.txt
index f624fe3..8abce32 100644
--- a/sim/src/ed25519_pub_key-rs.txt
+++ b/sim/src/ed25519_pub_key-rs.txt
@@ -1,4 +1,4 @@
-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,
diff --git a/sim/src/lib.rs b/sim/src/lib.rs
index 93cdbfa..e602327 100644
--- a/sim/src/lib.rs
+++ b/sim/src/lib.rs
@@ -33,7 +33,7 @@
},
};
-const USAGE: &'static str = "
+const USAGE: &str = "
Mcuboot simulator
Usage:
@@ -67,7 +67,7 @@
Nrf52840UnequalSlots,
}
-pub static ALL_DEVICES: &'static [DeviceName] = &[
+pub static ALL_DEVICES: &[DeviceName] = &[
DeviceName::Stm32f4,
DeviceName::K64f,
DeviceName::K64fBig,
diff --git a/sim/src/rsa3072_pub_key-rs.txt b/sim/src/rsa3072_pub_key-rs.txt
index 983009c..16ca30d 100644
--- a/sim/src/rsa3072_pub_key-rs.txt
+++ b/sim/src/rsa3072_pub_key-rs.txt
@@ -1,5 +1,5 @@
/* Autogenerated by imgtool.py, do not edit. */
-static RSA3072_PUB_KEY: &'static [u8] = &[
+static RSA3072_PUB_KEY: &[u8] = &[
0x30, 0x82, 0x01, 0x8a, 0x02, 0x82, 0x01, 0x81,
0x00, 0xb4, 0x2c, 0x0e, 0x98, 0x58, 0x10, 0xa4,
0xa7, 0x58, 0x99, 0x7c, 0x01, 0xdd, 0x08, 0x2a,
diff --git a/sim/src/rsa_pub_key-rs.txt b/sim/src/rsa_pub_key-rs.txt
index 288759d..f6466f8 100644
--- a/sim/src/rsa_pub_key-rs.txt
+++ b/sim/src/rsa_pub_key-rs.txt
@@ -1,5 +1,5 @@
/* Autogenerated by imgtool.py, do not edit. */
-static RSA_PUB_KEY: &'static [u8] = &[
+static RSA_PUB_KEY: &[u8] = &[
0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01,
0x00, 0xd1, 0x06, 0x08, 0x1a, 0x18, 0x44, 0x2c,
0x18, 0xe8, 0xfb, 0xfd, 0xf7, 0x0d, 0xa3, 0x4f,