Skip to content

Commit

Permalink
rename EmbeddedFs -> EmbeddedFS, add EmbeddedFS to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ahouts authored and manuel-woelker committed Oct 9, 2020
1 parent d8dd4e0 commit 5a872c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This crate currently has the following implementations:
* **MemoryFS** - an ephemeral in-memory file system, intended mainly for unit tests
* **AltrootFS** - a file system with its root in a particular directory of another filesystem
* **OverlayFS** - an overlay file system combining two filesystems, an upper layer with read/write access and a lower layer with only read access
* **EmbeddedFS** - a read-only file system embedded in the executable, requires `embedded-fs` feature

The minimum supported Rust version is 1.32.0.

Expand Down
12 changes: 6 additions & 6 deletions src/impls/embedded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ use std::path::Path;
#[derive(Debug)]
/// a read-only file system embedded in the executable
/// see [rust-embed](https://docs.rs/rust-embed/) for how to create a `RustEmbed`
pub struct EmbeddedFs<T>
pub struct EmbeddedFS<T>
where
T: RustEmbed + Send + Sync + Debug + 'static,
{
p: PhantomData<T>,
path_trie: Trie<String, bool>,
}

impl<T> EmbeddedFs<T>
impl<T> EmbeddedFS<T>
where
T: RustEmbed + Send + Sync + Debug + 'static,
{
pub fn new() -> Self {
EmbeddedFs {
EmbeddedFS {
p: PhantomData::default(),
path_trie: T::iter()
.map(|p| {
Expand All @@ -42,7 +42,7 @@ where
}
}

impl<T> FileSystem for EmbeddedFs<T>
impl<T> FileSystem for EmbeddedFS<T>
where
T: RustEmbed + Send + Sync + Debug + 'static,
{
Expand Down Expand Up @@ -156,8 +156,8 @@ mod tests {
#[folder = "test/test_embedded_directory"]
struct TestEmbed;

fn get_test_fs() -> EmbeddedFs<TestEmbed> {
EmbeddedFs::new()
fn get_test_fs() -> EmbeddedFS<TestEmbed> {
EmbeddedFS::new()
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! * **[`MemoryFS`](impls/memory/struct.MemoryFS.html)** - an ephemeral in-memory implementation (intended for unit tests)
//! * **[`AltrootFS`](impls/altroot/struct.AltrootFS.html)** - a file system with its root in a particular directory of another filesystem
//! * **[`OverlayFS`](impls/overlay/struct.OverlayFS.html)** - a union file system consisting of a read/writable upper layer and several read-only lower layers
//! * **[`EmbeddedFs`](impls/embedded/struct.EmbeddedFs.html)** - a read-only file system embedded in the executable, requires `embedded-fs` feature
//! * **[`EmbeddedFS`](impls/embedded/struct.EmbeddedFs.html)** - a read-only file system embedded in the executable, requires `embedded-fs` feature
//!
//! # Usage Examples
//!
Expand Down Expand Up @@ -57,7 +57,7 @@ pub mod path;
pub use error::{VfsError, VfsResult};
pub use filesystem::FileSystem;
#[cfg(feature = "embedded-fs")]
pub use impls::embedded::EmbeddedFs;
pub use impls::embedded::EmbeddedFS;
pub use impls::memory::MemoryFS;
pub use impls::physical::PhysicalFS;
pub use path::*;

0 comments on commit 5a872c7

Please sign in to comment.