Remove heapless-bytes

This commit is contained in:
Nicolas Stalder
2021-01-31 13:39:04 +01:00
committed by Nicolas Stalder
parent 4a83fc2149
commit 3e75276e2d
4 changed files with 48 additions and 3 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ bitflags = "1.0.4"
cty = "0.2.1"
generic-array = "0.13.2"
# heapless = "0.5.1"
heapless-bytes = { path = "../heapless-bytes", optional = true }
# heapless-bytes = { path = "../heapless-bytes", optional = true }
# Listed as regular dependency behind feature flag,
# since dev-dependencies cannot be optional, and we
@@ -45,7 +45,7 @@ serde = { version = "1.0", default-features = false, features = ["derive"] }
[features]
# default = ["closures"]
# use experimental closure-based API
closures = ["aligned", "heapless-bytes"]
closures = ["aligned"] # , "heapless-bytes"]
dir-entry-path = []
# enable assertions in backend C code
ll-assertions = ["littlefs2-sys/assertions"]
+2 -1
View File
@@ -1,5 +1,6 @@
[build]
command = "curl https://sh.rustup.rs -sSf | sh -s -- -y && source $HOME/.cargo/env && sudo apt-get install llvm && cargo doc"
# command = "curl https://sh.rustup.rs -sSf | sh -s -- -y && source $HOME/.cargo/env && sudo apt-get install llvm && cargo doc"
command = "curl https://sh.rustup.rs -sSf | sh -s -- -y && source $HOME/.cargo/env && env && cargo doc"
publish = "target/doc"
[[redirects]]
+33
View File
@@ -1262,6 +1262,39 @@ mod tests {
fs.write("/z.txt", &jackson5).unwrap();
}
#[test]
fn nested() {
let mut test_storage = TestStorage::new();
Filesystem::format(&mut test_storage).unwrap();
Filesystem::mount_and_then(&mut test_storage, |fs| {
fs.write("a.txt", &[])?;
fs.write("b.txt", &[])?;
fs.write("c.txt", &[])?;
fs.read_dir_and_then(".", |read_dir| {
for entry in read_dir {
let entry = entry?;
println!("{:?}", entry.file_type());
// The `&mut ReadDir` is not actually available here
// Do we want a way to borrow_filesystem for DirEntry?
// One usecase is to read data from the files iterated over.
//
// unsafe { read_dir.borrow_filesystem() }.write(
// &entry.file_name()[..],
// b"wowee zowie"
// )?;
}
Ok(())
})?;
Ok(())
}).unwrap();
}
#[test]
fn issue_3_original_report() {
let mut test_storage = TestStorage::new();
+11
View File
@@ -22,6 +22,17 @@ where
<S as driver::Storage>::FILENAME_MAX_PLUS_ONE: ArrayLength<u8>,
;
impl<S> core::ops::Deref for Filename<S>
where
S: driver::Storage,
<S as driver::Storage>::FILENAME_MAX_PLUS_ONE: ArrayLength<u8>,
{
type Target = [u8];
fn deref(&self) -> &Self::Target {
&self.0
}
}
// to compare filename
impl<S> cmp::PartialEq for Filename<S>
where