refactor: fix clippy lints
This commit is contained in:
parent
3f994e6184
commit
7c271f8be9
1 changed files with 4 additions and 5 deletions
|
|
@ -114,7 +114,6 @@ impl State {
|
||||||
}
|
}
|
||||||
Message::SavePathPicked(result) => {
|
Message::SavePathPicked(result) => {
|
||||||
self.error = result
|
self.error = result
|
||||||
.map_err(Cow::from)
|
|
||||||
.and_then(|path| {
|
.and_then(|path| {
|
||||||
self.image.as_ref().map_or_else(
|
self.image.as_ref().map_or_else(
|
||||||
|| Err("no image to save".into()),
|
|| Err("no image to save".into()),
|
||||||
|
|
@ -169,7 +168,7 @@ impl State {
|
||||||
|
|
||||||
Message::Yank => {
|
Message::Yank => {
|
||||||
if let Some(image) = self.image.as_ref() {
|
if let Some(image) = self.image.as_ref() {
|
||||||
return clipboard::write(utils::clipboard_image_from_rgbaimage(&image))
|
return clipboard::write(utils::clipboard_image_from_rgbaimage(image))
|
||||||
.map(Message::ImageYanked);
|
.map(Message::ImageYanked);
|
||||||
} else {
|
} else {
|
||||||
self.error = Some("no image to yank".into());
|
self.error = Some("no image to yank".into());
|
||||||
|
|
@ -184,7 +183,7 @@ impl State {
|
||||||
self.error = result.as_ref().err().map(|e| format!("{e:?}").into());
|
self.error = result.as_ref().err().map(|e| format!("{e:?}").into());
|
||||||
|
|
||||||
if let Ok(image) = result {
|
if let Ok(image) = result {
|
||||||
self.info = Some(format!("{}x{}", image.size.width, image.size.height,));
|
self.info = Some(format!("{}x{}", image.size.width, image.size.height));
|
||||||
if (image.size.width, image.size.height) < (100, 100) {
|
if (image.size.width, image.size.height) < (100, 100) {
|
||||||
self.image_filter = widget::image::FilterMethod::Nearest;
|
self.image_filter = widget::image::FilterMethod::Nearest;
|
||||||
}
|
}
|
||||||
|
|
@ -274,8 +273,8 @@ impl State {
|
||||||
Key::Character("s") => Some(Message::Save),
|
Key::Character("s") => Some(Message::Save),
|
||||||
Key::Character("q") => Some(Message::Quit),
|
Key::Character("q") => Some(Message::Quit),
|
||||||
|
|
||||||
Key::Character("y") | Key::Character("c") => Some(Message::Yank),
|
Key::Character("y" | "c") => Some(Message::Yank),
|
||||||
Key::Character("p") | Key::Character("v") => Some(Message::Put),
|
Key::Character("p" | "v") => Some(Message::Put),
|
||||||
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue