diff --git a/src/depcheck.rs b/src/depcheck.rs index 8580417..0980fd8 100644 --- a/src/depcheck.rs +++ b/src/depcheck.rs @@ -1,4 +1,4 @@ -use std::{env, path::Path}; +use std::{env, fmt::Display, path::Path}; #[derive(Debug, Clone, PartialEq, Eq)] pub enum DepType { @@ -20,6 +20,19 @@ pub struct DependencyCheckResult { pub found: bool, } +impl Display for DependencyCheckResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_fmt(format_args!( + "{name} {result}", + name = self.dependency.name, + result = match self.found { + true => "Found", + false => "Not found", + } + )) + } +} + fn shared_obj_paths() -> Vec { vec![ "/lib".to_string(),