diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-04-25 12:57:43 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-04-25 12:58:27 -0400 |
commit | ea0ea2f394f27ab7eb92d62bf54c64fd8ab32752 (patch) | |
tree | 97210eb14ef02cb4d9cb1db1d1678ef8ab50e632 /src/fs | |
parent | 18a5b367246f04955ee64e938033437295f045ad (diff) |
add support for glob file selection
- rename some command configurations
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/dirlist.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fs/dirlist.rs b/src/fs/dirlist.rs index 797a83e..279fcae 100644 --- a/src/fs/dirlist.rs +++ b/src/fs/dirlist.rs @@ -1,4 +1,4 @@ -use std::slice::Iter; +use std::slice::{Iter, IterMut}; use std::{fs, path}; use crate::fs::{JoshutoDirEntry, JoshutoMetadata}; @@ -36,6 +36,14 @@ impl JoshutoDirList { self.contents.iter() } + pub fn iter_mut(&mut self) -> IterMut<JoshutoDirEntry> { + self.contents.iter_mut() + } + + pub fn len(&self) -> usize { + self.contents.len() + } + pub fn modified(&self) -> bool { let metadata = std::fs::symlink_metadata(self.file_path()); match metadata { |