Skip to content

Commit 109bc36

Browse files
authored
Update commands.rs
1 parent ff7c993 commit 109bc36

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

hacker/atomic/src/commands.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ use crate::SystemCommands;
55
use crate::RunCommands;
66
use std::io::{self, BufRead};
77
use std::fs::{self, File};
8-
use std::path::Path;
9-
use std::process::{Command, Stdio};
108
use chrono::{DateTime, Utc, Duration as ChronoDuration};
11-
use std::env;
129

1310
pub fn handle_unpack(unpack_command: UnpackCommands) {
1411
match unpack_command {
@@ -210,9 +207,9 @@ pub fn handle_back() {
210207
let snapshot_dir = "/var/cache/hacker/";
211208
// Find latest current- snapshot
212209
let mut snapshots: Vec<_> = fs::read_dir(snapshot_dir).unwrap()
213-
.filter_map(|e| e.ok())
214-
.filter(|e| e.file_name().to_string_lossy().starts_with("current-"))
215-
.collect();
210+
.filter_map(|e| e.ok())
211+
.filter(|e| e.file_name().to_string_lossy().starts_with("current-"))
212+
.collect();
216213
snapshots.sort_by_key(|e| e.metadata().unwrap().modified().unwrap());
217214
if let Some(latest) = snapshots.last() {
218215
let path = latest.path().to_string_lossy().to_string();

0 commit comments

Comments
 (0)