summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Bassi <calebjbassi@gmail.com>2019-02-15 02:25:01 -0800
committerCaleb Bassi <calebjbassi@gmail.com>2019-02-15 05:20:28 -0800
commitb35b77df864cd09836e8d9d5aa85064698addbb2 (patch)
treeca7d42ab12baa4b522d08a8f94e52873d8b4e77a
parent63472555d504580c606fed9a63ad16a1020b0c84 (diff)
cargo fmt
-rw-r--r--src/joshuto/command/file_operations.rs36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/joshuto/command/file_operations.rs b/src/joshuto/command/file_operations.rs
index 73cf903..f64287e 100644
--- a/src/joshuto/command/file_operations.rs
+++ b/src/joshuto/command/file_operations.rs
@@ -156,7 +156,10 @@ impl PasteFiles {
{
let paths = selected_files.lock().unwrap();
if paths.len() == 0 {
- return Err(std::io::Error::new(std::io::ErrorKind::Other, "no files selected"));
+ return Err(std::io::Error::new(
+ std::io::ErrorKind::Other,
+ "no files selected",
+ ));
}
path_ino = paths[0].metadata()?.st_dev();
}
@@ -164,7 +167,7 @@ impl PasteFiles {
let (tx, rx) = sync::mpsc::channel();
let handle;
if dest_ino == path_ino {
- handle = thread::spawn(move || {
+ handle = thread::spawn(move || {
let mut paths = selected_files.lock().unwrap();
let mut progress_info = ProgressInfo {
bytes_finished: 1,
@@ -232,26 +235,29 @@ impl PasteFiles {
{
let paths = selected_files.lock().unwrap();
if paths.len() == 0 {
- return Err(std::io::Error::new(std::io::ErrorKind::Other, "no files selected"));
+ return Err(std::io::Error::new(
+ std::io::ErrorKind::Other,
+ "no files selected",
+ ));
}
}
let handle = thread::spawn(move || {
- let mut paths = selected_files.lock().unwrap();
+ let mut paths = selected_files.lock().unwrap();
- let handle = |process_info: fs_extra::TransitProcess| {
- let progress_info = ProgressInfo {
- bytes_finished: process_info.copied_bytes,
- total_bytes: process_info.total_bytes,
- };
- tx.send(progress_info).unwrap();
- fs_extra::dir::TransitProcessResult::ContinueOrAbort
+ let handle = |process_info: fs_extra::TransitProcess| {
+ let progress_info = ProgressInfo {
+ bytes_finished: process_info.copied_bytes,
+ total_bytes: process_info.total_bytes,
};
+ tx.send(progress_info).unwrap();
+ fs_extra::dir::TransitProcessResult::ContinueOrAbort
+ };
- fs_extra::move_items_with_progress(&paths, &destination, &options, handle).unwrap();
- paths.clear();
- 0
- });
+ fs_extra::move_items_with_progress(&paths, &destination, &options, handle).unwrap();
+ paths.clear();
+ 0
+ });
let thread = FileOperationThread {
tab_src: tab_src_index,
tab_dest,