From d3ea07c499afeca0ea031ed3b261226f4d05f40e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 29 Dec 2021 13:07:57 +1300 Subject: [PATCH] Deps: Use nfd2 crate instead of the nfd-rs Apparently the "nfd-rs" crate has been superseded by a newer version that is more actively maintained + contains a number of bugfixes. --- Cargo.lock | 16 +++++----------- Cargo.toml | 2 +- src/widgets/picture_widget.rs | 6 +++--- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17591696..0ca3fb08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -692,7 +692,7 @@ dependencies = [ "lexical-sort", "libavif-image", "log", - "nfd", + "nfd2", "open", "rand", "resvg", @@ -852,12 +852,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -[[package]] -name = "gcc" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" - [[package]] name = "gelatin" version = "0.7.0" @@ -1483,12 +1477,12 @@ dependencies = [ ] [[package]] -name = "nfd" -version = "0.0.4" +name = "nfd2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e752e3c216bc8a491c5b59fa46da10f1379ae450b19ac688e07f4bb55042e98" +checksum = "306127f5ff8cb7c8cd3a8cf0fc162f4dc76ed589efa01ee84eb5593e7be97f75" dependencies = [ - "gcc", + "cc", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fa8b7be8..5e11b7cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -85,7 +85,7 @@ usvg = "0.14.1" tiny-skia = "0.5.1" log = "0.4" env_logger = "0.8" -nfd = "0.0.4" +nfd2 = "0.3.0" [dependencies.libavif-image] version = "0.6.0" diff --git a/src/widgets/picture_widget.rs b/src/widgets/picture_widget.rs index 703000ff..25a81186 100644 --- a/src/widgets/picture_widget.rs +++ b/src/widgets/picture_widget.rs @@ -4,8 +4,8 @@ use std::rc::{Rc, Weak}; use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; -extern crate nfd; -use nfd::Response; +extern crate nfd2; +use nfd2::Response; use gelatin::cgmath::{Matrix4, Vector2, Vector3}; use gelatin::glium::glutin::event::{ElementState, ModifiersState, MouseButton}; @@ -623,8 +623,8 @@ impl PictureWidget { } } if triggered!(IMG_BROWSE_NAME) { - match nfd::open_file_dialog(None, None).expect("file dialog error") { // TODO: Restrict to only supported image types + match nfd2::open_file_dialog(None, None).expect("file dialog error") { Response::Okay(file_path) => { println!("Selected File Path = {:?}", file_path); let file_path_buf = PathBuf::from(file_path.clone());