Show the installation method used

This commit is contained in:
Robbert van der Helm
2020-07-15 16:10:52 +02:00
parent fefce517d0
commit ac5c6bab67
2 changed files with 15 additions and 3 deletions
+10
View File
@@ -66,6 +66,16 @@ pub enum InstallationMethod {
Symlink,
}
impl InstallationMethod {
/// The plural term for this installation methodd, using in string formatting.
pub fn plural(&self) -> &str {
match &self {
InstallationMethod::Copy => "copies",
InstallationMethod::Symlink => "symlinks",
}
}
}
impl Display for InstallationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self {