Skip to content

Commit

Permalink
chore: replace lazy_static to spin::lazy::Lazy
Browse files Browse the repository at this point in the history
Signed-off-by: tfx2001 <[email protected]>
  • Loading branch information
tfx2001 committed Aug 4, 2024
1 parent 4637e86 commit 01134d6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ riscv = "0.10"
spin = "0.9"
fast-trap = { version = "0.0.1", features = ["riscv-m"] }
riscv-decode = "0.2.1"
lazy_static = { version = "1.5.0", features = ["spin_no_std"] }

[build-dependencies]
hpm-rt = { git = "https://github.com/hpm-rs/hpm-rt.git", rev = "66ffb7d7a65d7251d0b47db9599d36cefc4d6703" }
Expand Down
11 changes: 4 additions & 7 deletions src/extension.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use rustsbi::RustSBI;
use spin::Lazy;

use crate::board::{board_init_timer, MachineTimer};

Expand All @@ -8,10 +9,6 @@ pub struct FixedRustSBI {
pub timer: MachineTimer,
}

lazy_static! {
pub static ref SBI: FixedRustSBI = {
FixedRustSBI {
timer: board_init_timer(),
}
};
}
pub static SBI: Lazy<FixedRustSBI> = Lazy::new(|| FixedRustSBI {
timer: board_init_timer(),
});
3 changes: 0 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#![feature(naked_functions, asm_const)]
#![deny(warnings)]

#[macro_use]
extern crate lazy_static;

mod board;
mod extension;
mod loader;
Expand Down

0 comments on commit 01134d6

Please sign in to comment.