Skip to content

Commit

Permalink
remove dependency from lazy_static
Browse files Browse the repository at this point in the history
- requires PR rust-lang/rust#71839
- consequently, the latest nightly compiler has to be used
  • Loading branch information
stlankes committed May 20, 2020
1 parent d34ee42 commit fc5d048
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
16 changes: 0 additions & 16 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 @@ -34,7 +34,6 @@ acpi = []
bitflags = "1.2"
#cfg-if = "0.1"
#byteorder = { version = "1.0", default-features = false }
lazy_static = { version = "1.4.0", default-features = false, features = ["spin_no_std"] }
num-derive = "0.3"

[dependencies.num]
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#![allow(clippy::forget_copy)]
#![feature(abi_x86_interrupt)]
#![feature(allocator_api)]
#![feature(const_btree_new)]
#![feature(const_fn)]
#![feature(lang_items)]
#![feature(linkage)]
Expand Down Expand Up @@ -51,8 +52,6 @@ extern crate multiboot;
extern crate x86;
#[macro_use]
extern crate log;
#[macro_use]
extern crate lazy_static;
extern crate num;
#[macro_use]
extern crate num_derive;
Expand Down
6 changes: 2 additions & 4 deletions src/syscalls/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ TODO:
*/

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

pub struct Filesystem {
// Keep track of mount-points
Expand All @@ -64,7 +62,7 @@ pub struct Filesystem {
}

impl Filesystem {
pub fn new() -> Self {
pub const fn new() -> Self {
Self {
mounts: BTreeMap::new(),
files: BTreeMap::new(),
Expand Down

0 comments on commit fc5d048

Please sign in to comment.