1
0
mirror of https://github.com/Tim-Paik/neutauri.git synced 2024-10-12 23:29:41 +00:00

Update wry to 0.22, fix clippy

This commit is contained in:
2022-11-28 19:47:41 +08:00
parent 915b34cb5d
commit 69531170b9
8 changed files with 856 additions and 395 deletions

View File

@ -10,7 +10,7 @@ image = {version = "0.24", optional = true}
new_mime_guess = {version = "4.0", optional = true}
serde = {version = "1.0", features = ["derive"]}
toml = {version = "0.5", optional = true}
wry = {version = "0.20", default-features = false, features = ["protocol", "tray", "transparent", "fullscreen"]}
wry = {version = "0.22", default-features = false, features = ["protocol", "tray", "transparent", "fullscreen"]}
[features]
bundler = ["new_mime_guess", "toml", "image"]

View File

@ -168,7 +168,7 @@ impl Data {
Ok(fs)
}
fn open_file(&self, current_dir: &Dir, mut path: path::Iter) -> Result<File> {
fn open_file(current_dir: &Dir, mut path: path::Iter) -> Result<File> {
let next_path = match path.next() {
Some(str) => str.to_string_lossy().to_string(),
None => return Err(io::Error::new(io::ErrorKind::NotFound, "file not found")),
@ -180,7 +180,7 @@ impl Data {
}
for (name, dir) in &current_dir.dirs {
if next_path == *name {
return self.open_file(dir, path);
return Self::open_file(dir, path);
}
}
Err(io::Error::new(io::ErrorKind::NotFound, "file not found"))
@ -195,7 +195,7 @@ impl Data {
} else {
path
};
self.open_file(&self.fs, path.iter())
Self::open_file(&self.fs, path.iter())
}
}
@ -296,7 +296,7 @@ impl Data {
let mut target: Vec<u8> = Vec::new();
target.extend(MAGIC_NUMBER_START);
target.extend(&data.len().to_be_bytes());
target.extend(data.len().to_be_bytes());
target.extend(&data);
let target_length = target.len();
let target_length = target_length + USIZE_LEN;