cargo: Update and cleanup dependencies

- Replace one remaining use of util::spawn with gio
- Replace pretty_env_logger with env_logger

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/149>
This commit is contained in:
Sophie Herold 2023-03-20 17:15:52 +01:00 • committed by Marge Bot
parent 52c6f4333d
commit 7bcc5e210b
5 changed files with 226 additions and 281 deletions

483
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -12,19 +12,15 @@ codegen-units = 1
[dependencies] [dependencies]
anyhow = { version = "1.0.66", features = ["backtrace"] } anyhow = { version = "1.0.66", features = ["backtrace"] }
arc-swap = "1.6.0" arc-swap = "1.6.0"
async-global-executor = "2.3.1" env_logger = "0.10.0"
async-std = "1.12.0"
futures = "0.3.25" futures = "0.3.25"
futures-channel = "0.3.25"
gtk-macros = "0.3.0" gtk-macros = "0.3.0"
indexmap = "1.9.2" indexmap = "1.9.2"
kamadak-exif = "0.5.5" kamadak-exif = "0.5.5"
libgweather = "4.2.0" libgweather = "4.2.0"
log = "0.4.17" log = "0.4.17"
once_cell = "1.16.0" once_cell = "1.16.0"
pretty_env_logger = "0.4.0"
safe-transmute = "0.11.2" safe-transmute = "0.11.2"
url = "2.3.1"
# decoders # decoders
image-rs = { package = "image", version = "*", git = "https://github.com/image-rs/image.git" } image-rs = { package = "image", version = "*", git = "https://github.com/image-rs/image.git" }

View file

@ -98,7 +98,7 @@ impl LpFileModel {
); );
self.imp().monitor.set(monitor).unwrap(); self.imp().monitor.set(monitor).unwrap();
let new_files_result = util::spawn("list-files", move || { let new_files_result = gio::spawn_blocking(move || {
let mut files = IndexSet::new(); let mut files = IndexSet::new();
let enumerator = gio::File::for_path(&directory) let enumerator = gio::File::for_path(&directory)

View file

@ -67,7 +67,9 @@ use application::LpApplication;
use deps::*; use deps::*;
fn main() -> glib::ExitCode { fn main() -> glib::ExitCode {
pretty_env_logger::init_timed(); env_logger::Builder::from_default_env()
.format_timestamp_millis()
.init();
setlocale(LocaleCategory::LcAll, ""); setlocale(LocaleCategory::LcAll, "");
bindtextdomain("loupe", config::LOCALEDIR).unwrap(); bindtextdomain("loupe", config::LOCALEDIR).unwrap();

View file

@ -155,18 +155,6 @@ pub async fn untrash(path: &Path) -> anyhow::Result<()> {
error error
} }
pub async fn spawn<T: Debug + Send + 'static>(
name: &str,
f: impl Fn() -> T + Send + 'static,
) -> async_std::io::Result<T> {
log::trace!("Starting thread '{name}'");
Ok(async_std::task::Builder::new()
.name(name.to_string())
.spawn(async_global_executor::spawn_blocking(f))?
.await)
}
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]
pub enum Position { pub enum Position {
First, First,