added custom debug impl for Link

This commit is contained in:
2026-03-16 23:00:42 +01:00
parent b6b3759446
commit 6c634824a8

View File

@@ -1,11 +1,14 @@
use std::path::{Path, PathBuf};
use std::{
fmt::Debug,
path::{Path, PathBuf},
};
use serde::{Deserialize, Serialize};
use crate::types::mod_file::ModFile;
/// A link between a file from a mod and a destination in a ModdedInstance
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Hash)]
#[derive(Clone, Deserialize, Serialize, PartialEq, Eq, Hash)]
#[serde(from = "(PathBuf, PathBuf)", into = "(PathBuf,PathBuf)")]
pub struct Link {
src: PathBuf,
@@ -53,3 +56,9 @@ impl From<ModFile> for Link {
Self::new(value.src(), value.dst())
}
}
impl Debug for Link {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Link{{{:?} -> {:?}}}", self.src, self.dst,)
}
}