Skip to content

Commit c4574b4

Browse files
committed
fix: use const instead of static
Signed-off-by: Woshiluo Luo <woshiluo.luo@outlook.com>
1 parent 720a12b commit c4574b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/de.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use serde::de;
3131
/// # Example
3232
///
3333
/// ```
34-
/// # static RAW_DEVICE_TREE: &'static [u8] = include_bytes!("../examples/hifive-unmatched-a00.dtb");
34+
/// # const RAW_DEVICE_TREE: &'static [u8] = include_bytes!("../examples/hifive-unmatched-a00.dtb");
3535
/// # const BUFFER_SIZE: usize = RAW_DEVICE_TREE.len();
3636
/// # #[repr(align(4))]
3737
/// # struct AlignedBuffer {
@@ -521,7 +521,7 @@ mod tests {
521521
#[cfg(any(feature = "std", feature = "alloc"))]
522522
#[test]
523523
fn error_invalid_magic() {
524-
static DEVICE_TREE: &[u8] = &[0x11, 0x22, 0x33, 0x44]; // not device tree blob format
524+
const DEVICE_TREE: &[u8] = &[0x11, 0x22, 0x33, 0x44]; // not device tree blob format
525525
const DEVICE_TREE_LEN: usize = DEVICE_TREE.len();
526526
#[repr(align(8))]
527527
struct AlignedBuffer {

src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ mod tests {
5858
buildin::{Node, StrSeq},
5959
from_raw_mut, Dtb, DtbPtr,
6060
};
61-
static RAW_DEVICE_TREE: &[u8] = include_bytes!("../../examples/hifive-unmatched-a00.dtb");
61+
const RAW_DEVICE_TREE: &[u8] = include_bytes!("../../examples/hifive-unmatched-a00.dtb");
6262
const BUFFER_SIZE: usize = RAW_DEVICE_TREE.len();
6363
#[repr(align(8))]
6464
struct AlignedBuffer {

0 commit comments

Comments
 (0)