Skip to content

Commit fc5d048

Browse files
committed
remove dependency from lazy_static
- requires PR rust-lang/rust#71839 - consequently, the latest nightly compiler has to be used
1 parent d34ee42 commit fc5d048

File tree

4 files changed

+3
-23
lines changed

4 files changed

+3
-23
lines changed

Cargo.lock

-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ acpi = []
3434
bitflags = "1.2"
3535
#cfg-if = "0.1"
3636
#byteorder = { version = "1.0", default-features = false }
37-
lazy_static = { version = "1.4.0", default-features = false, features = ["spin_no_std"] }
3837
num-derive = "0.3"
3938

4039
[dependencies.num]

src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#![allow(clippy::forget_copy)]
2525
#![feature(abi_x86_interrupt)]
2626
#![feature(allocator_api)]
27+
#![feature(const_btree_new)]
2728
#![feature(const_fn)]
2829
#![feature(lang_items)]
2930
#![feature(linkage)]
@@ -51,8 +52,6 @@ extern crate multiboot;
5152
extern crate x86;
5253
#[macro_use]
5354
extern crate log;
54-
#[macro_use]
55-
extern crate lazy_static;
5655
extern crate num;
5756
#[macro_use]
5857
extern crate num_derive;

src/syscalls/fs.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ TODO:
5151
*/
5252

5353
// TODO: lazy static could be replaced with explicit init on OS boot.
54-
lazy_static! {
55-
pub static ref FILESYSTEM: Spinlock<Filesystem> = Spinlock::new(Filesystem::new());
56-
}
54+
pub static FILESYSTEM: Spinlock<Filesystem> = Spinlock::new(Filesystem::new());
5755

5856
pub struct Filesystem {
5957
// Keep track of mount-points
@@ -64,7 +62,7 @@ pub struct Filesystem {
6462
}
6563

6664
impl Filesystem {
67-
pub fn new() -> Self {
65+
pub const fn new() -> Self {
6866
Self {
6967
mounts: BTreeMap::new(),
7068
files: BTreeMap::new(),

0 commit comments

Comments
 (0)