Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dependency to lazy_static #54

Merged
merged 1 commit into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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