From 3c35457b60d38fcb623dfb0ac18ce50f1dbe42ef Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 25 Mar 2025 15:51:35 -0600 Subject: [PATCH] Switch from failure to anyhow --- Cargo.toml | 2 +- src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index efd60dc490..e051452d3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -failure = "0.1.8" +anyhow = "1" pkgar = "0.1.9" pkgar-core = "0.1.0" pkgar-keys = "0.1.0" diff --git a/src/main.rs b/src/main.rs index 9e7d80debe..f9c73159b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,9 @@ +use anyhow::format_err; use cosmic::iced::{ self, executor, theme, widget::{button, column, horizontal_space, progress_bar, radio, row, text, vertical_space}, window, Alignment, Application, Command, Element, Length, Settings, Size, Subscription, Theme, }; -use failure::format_err; use pkgar::{ext::EntryExt, PackageHead}; use pkgar_core::PackageSrc; use pkgar_keys::PublicKeyFile; @@ -105,7 +105,7 @@ fn format_size(size: u64) -> String { } } -fn copy_file(src: &Path, dest: &Path, buf: &mut [u8]) -> Result<(), failure::Error> { +fn copy_file(src: &Path, dest: &Path, buf: &mut [u8]) -> anyhow::Result<()> { if let Some(parent) = dest.parent() { // Parent may be a symlink if ! parent.is_symlink() { @@ -318,7 +318,7 @@ fn install(disk_path: String, password_opt: Option, m let res = with_whole_disk( &disk_path, &disk_option, - |mount_path| -> Result<(), failure::Error> { + |mount_path: &Path| -> anyhow::Result<()> { message!("Loading filesystem.toml"); let mut config: Config = { let path = root_path.join("filesystem.toml");