Skip to content

Commit

Permalink
apply suggested fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TeFiLeDo committed Sep 24, 2023
1 parent 5ad2ece commit 5b0a00d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
5 changes: 4 additions & 1 deletion src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<IdError>, Vec<IdError>) {
let mut user_failures = vec![];
for (uid, name) in &mut self.users {
if name.is_some() {
Expand Down

0 comments on commit 5b0a00d

Please sign in to comment.