mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
fix error message when compressing zip archive
This commit is contained in:
parent
79597f48bb
commit
a29ff3c637
@ -4,7 +4,6 @@
|
|||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
use std::{
|
use std::{
|
||||||
env,
|
env,
|
||||||
fs::File,
|
|
||||||
io::{self, prelude::*},
|
io::{self, prelude::*},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
sync::mpsc,
|
sync::mpsc,
|
||||||
@ -223,7 +222,7 @@ where
|
|||||||
options
|
options
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut file = File::open(entry.path())?;
|
let mut file = fs::File::open(entry.path())?;
|
||||||
writer.start_file(
|
writer.start_file(
|
||||||
path.to_str().unwrap(),
|
path.to_str().unwrap(),
|
||||||
options.last_modified_time(get_last_modified_time(&file)),
|
options.last_modified_time(get_last_modified_time(&file)),
|
||||||
@ -256,7 +255,7 @@ fn display_zip_comment_if_exists(file: &ZipFile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_last_modified_time(file: &File) -> DateTime {
|
fn get_last_modified_time(file: &fs::File) -> DateTime {
|
||||||
file.metadata()
|
file.metadata()
|
||||||
.and_then(|metadata| metadata.modified())
|
.and_then(|metadata| metadata.modified())
|
||||||
.map_err(|_| ())
|
.map_err(|_| ())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user