mirror of
https://github.com/RGBCube/dix
synced 2025-07-27 11:47:46 +00:00
fix: use Self and don't depend on nightly features
This commit is contained in:
parent
60d7a4d9ae
commit
f4357e1c50
2 changed files with 5 additions and 4 deletions
|
@ -35,9 +35,9 @@ enum DiffStatus {
|
||||||
impl DiffStatus {
|
impl DiffStatus {
|
||||||
fn char(self) -> impl fmt::Display {
|
fn char(self) -> impl fmt::Display {
|
||||||
match self {
|
match self {
|
||||||
DiffStatus::Added => "A".green(),
|
Self::Added => "A".green(),
|
||||||
DiffStatus::Removed => "R".red(),
|
Self::Removed => "R".red(),
|
||||||
DiffStatus::Changed => "C".yellow(),
|
Self::Changed => "C".yellow(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,8 @@ fn path_to_canonical_string(path: &Path) -> Result<String> {
|
||||||
let path = path.into_os_string().into_string().map_err(|path| {
|
let path = path.into_os_string().into_string().map_err(|path| {
|
||||||
anyhow!(
|
anyhow!(
|
||||||
"failed to convert path '{path}' to valid unicode",
|
"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. */
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue