diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-03-25 12:46:49 +1300 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-03-25 12:48:49 +1300 |
commit | ab84ad75629b0a4124221023ca91411d2cd62a32 (patch) | |
tree | 0c333f06bec5270084aaec71cf173c798420207b /src/devices/file_device/entry.rs | |
parent | 07ae3438917fd854a46924a410f6890cd0651f1b (diff) | |
download | bedrock-pc-ab84ad75629b0a4124221023ca91411d2cd62a32.zip |
Restructure program
This commit also includes changes to devices according to the latest
devices specification, in particular the math and system devices.
Diffstat (limited to 'src/devices/file_device/entry.rs')
-rw-r--r-- | src/devices/file_device/entry.rs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/devices/file_device/entry.rs b/src/devices/file_device/entry.rs deleted file mode 100644 index d604bb7..0000000 --- a/src/devices/file_device/entry.rs +++ /dev/null @@ -1,36 +0,0 @@ -use super::*; - -use std::cmp::Ordering; - -pub enum Entry { - File(BufferedFile), - Directory(DirectoryListing), -} - -#[derive(Copy, Clone, PartialEq, Eq)] -pub enum EntryType { - File, - Directory, -} - -impl PartialOrd for EntryType { - fn partial_cmp(&self, other: &Self) -> Option<Ordering> { - match (self, other) { - (EntryType::Directory, EntryType::Directory) => Some(Ordering::Equal ), - (EntryType::Directory, EntryType::File ) => Some(Ordering::Less ), - (EntryType::File, EntryType::Directory) => Some(Ordering::Greater), - (EntryType::File, EntryType::File ) => Some(Ordering::Equal ), - } - } -} - -impl Ord for EntryType { - fn cmp(&self, other: &Self) -> Ordering { - match (self, other) { - (EntryType::Directory, EntryType::Directory) => Ordering::Equal , - (EntryType::Directory, EntryType::File ) => Ordering::Less , - (EntryType::File, EntryType::Directory) => Ordering::Greater, - (EntryType::File, EntryType::File ) => Ordering::Equal , - } - } -} |