Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
Signed-off-by: Pushkar Mishra <[email protected]>
  • Loading branch information
Pushkarm029 committed Apr 16, 2024
1 parent d1d98df commit a541703
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fs-storage/examples/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ fn read_command(args: &[String], path: &str) -> Result<()> {
.read_fs()
.expect("No Data is present on this path");
if keys.is_empty() {
for (key, value) in map {
for (key, value) in &map {
println!("{}: {}", key, value);
}
}
for key in &keys {
if let Some(value) = fs.get(key) {
if let Some(value) = &map.get(key) {
println!("{}: {}", key, value);
} else {
eprintln!("Key '{}' not found", key);
Expand Down
1 change: 0 additions & 1 deletion fs-storage/src/base_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ where
K: FromStr + Hash + Eq + Ord + Debug + Clone,
V: Debug + Clone,
{
fn get(&self, id: &K) -> Option<&V>;
fn set(&mut self, id: K, value: V);
fn remove(&mut self, id: &K) -> Result<()>;

Expand Down
4 changes: 0 additions & 4 deletions fs-storage/src/file_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ where
+ serde::de::DeserializeOwned,
V: Debug + Clone + serde::Serialize + serde::de::DeserializeOwned,
{
fn get(&self, id: &K) -> Option<&V> {
self.data.get(id)
}

fn set(&mut self, id: K, value: V) {
self.data.insert(id, value);
self.timestamp = std::time::SystemTime::now();
Expand Down

0 comments on commit a541703

Please sign in to comment.