From 5b0a00d140b669b8e2f792bac8516083e5c92d47 Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Sun, 24 Sep 2023 14:46:17 +0200 Subject: [PATCH] apply suggested fixes --- src/main.rs | 2 +- src/summary.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index df82583..795b18d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::{fs::read_dir, os::linux::fs::MetadataExt, path::Path}; -use anyhow::{anyhow, ensure, Context, Error, Result}; +use anyhow::{anyhow, Context, Error, Result}; use clap::Parser; use crate::{cli::Args, summary::Summary}; diff --git a/src/summary.rs b/src/summary.rs index e5ccdf0..4987e77 100644 --- a/src/summary.rs +++ b/src/summary.rs @@ -3,6 +3,9 @@ use std::{collections::BTreeMap, fmt::Display}; use file_owner::{FileOwnerError, Group, Owner}; use serde::Serialize; +/// An error specific to a `uid` or `gid`. +pub type IdError = (u32, FileOwnerError); + /// Lists of unique [User]s and [Group]s. #[derive(Debug, Default, Serialize)] pub struct Summary { @@ -22,7 +25,7 @@ impl Summary { } /// Look up the names of all users and groups. - pub fn lookup_names(&mut self) -> (Vec<(u32, FileOwnerError)>, Vec<(u32, FileOwnerError)>) { + pub fn lookup_names(&mut self) -> (Vec, Vec) { let mut user_failures = vec![]; for (uid, name) in &mut self.users { if name.is_some() {