mirror of
https://github.com/TeFiLeDo/tree-owners.git
synced 2024-11-12 22:36:17 +01:00
apply suggested fixes
This commit is contained in:
parent
5ad2ece4e4
commit
5b0a00d140
@ -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};
|
||||
|
@ -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<IdError>, Vec<IdError>) {
|
||||
let mut user_failures = vec![];
|
||||
for (uid, name) in &mut self.users {
|
||||
if name.is_some() {
|
||||
|
Loading…
Reference in New Issue
Block a user