From f4357e1c506dcad8a4d83d257f0a75a7ac3e522d Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 9 May 2025 18:05:54 +0300 Subject: [PATCH] fix: use Self and don't depend on nightly features --- src/diff.rs | 6 +++--- src/store.rs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/diff.rs b/src/diff.rs index 932be08..5a2a463 100644 --- a/src/diff.rs +++ b/src/diff.rs @@ -35,9 +35,9 @@ enum DiffStatus { impl DiffStatus { fn char(self) -> impl fmt::Display { match self { - DiffStatus::Added => "A".green(), - DiffStatus::Removed => "R".red(), - DiffStatus::Changed => "C".yellow(), + Self::Added => "A".green(), + Self::Removed => "R".red(), + Self::Changed => "C".yellow(), } } } diff --git a/src/store.rs b/src/store.rs index 723f19b..561b561 100644 --- a/src/store.rs +++ b/src/store.rs @@ -41,7 +41,8 @@ fn path_to_canonical_string(path: &Path) -> Result { let path = path.into_os_string().into_string().map_err(|path| { anyhow!( "failed to convert path '{path}' to valid unicode", - path = path.display(), + path = Path::new(&*path).display(), /* TODO: use .display() directly + * after Rust 1.87.0 in flake. */ ) })?;