feat: display trait for DependencyCheckResult

This commit is contained in:
Gabriele Musco 2023-06-04 10:39:51 +02:00
commit 7e40e391fd

View file

@ -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<String> {
vec![
"/lib".to_string(),