Skip to content

Commit

Permalink
feat(vfs) mem-fs does not support enable-serde.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Aug 30, 2021
1 parent 650352d commit 87558a9
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 10 deletions.
3 changes: 3 additions & 0 deletions lib/vfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use thiserror::Error;
#[cfg(all(not(feature = "host-fs"), not(feature = "mem-fs")))]
compile_error!("At least the `host-fs` or the `mem-fs` feature must be enabled. Please, pick one.");

#[cfg(all(feature = "mem-fs", feature = "enable-serde"))]
compile_error!("`mem-fs` does not support `enable-serde` for the moment.");

#[cfg(feature = "host-fs")]
pub mod host_fs;
#[cfg(feature = "mem-fs")]
Expand Down
2 changes: 0 additions & 2 deletions lib/vfs/src/mem_fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use super::*;
use crate::{FileDescriptor, FsError, Result, VirtualFile};
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
use std::cmp;
use std::convert::TryInto;
use std::fmt;
Expand Down
2 changes: 0 additions & 2 deletions lib/vfs/src/mem_fs/file_opener.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use super::*;
use crate::{FileType, FsError, Metadata, OpenOptionsConfig, Result, VirtualFile};
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
use std::io::{self, Seek};
use std::path::Path;

Expand Down
2 changes: 0 additions & 2 deletions lib/vfs/src/mem_fs/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
use super::*;
use crate::{DirEntry, FileType, FsError, Metadata, OpenOptions, ReadDir, Result};
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
use slab::Slab;
use std::convert::identity;
use std::ffi::OsString;
Expand Down
4 changes: 0 additions & 4 deletions lib/vfs/src/mem_fs/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
//! `stdin`, `stdout` and `stderr`.
use crate::{FileDescriptor, FsError, Result, VirtualFile};
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
use std::io::{self, Read, Seek, Write};

macro_rules! impl_virtualfile_on_std_streams {
($name:ident { readable: $readable:expr, writable: $writable:expr $(,)* }) => {
/// A wrapper type around the standard I/O stream of the same
/// name that implements `VirtualFile`.
#[derive(Debug, Default)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct $name {
pub buf: Vec<u8>,
}
Expand All @@ -26,7 +23,6 @@ macro_rules! impl_virtualfile_on_std_streams {
}
}

#[cfg_attr(feature = "enable-serde", typetag::serde)]
impl VirtualFile for $name {
fn last_accessed(&self) -> u64 {
0
Expand Down

0 comments on commit 87558a9

Please sign in to comment.