dry4rust/cli/
ignore_entry_line.rs1use std::fmt;
7
8use crate::suppression::ignore_entry::IgnoreEntry;
9
10pub struct IgnoreEntryLine<'a> {
17 entry: &'a IgnoreEntry,
18}
19
20impl<'a> IgnoreEntryLine<'a> {
21 #[must_use]
22 pub const fn new(entry: &'a IgnoreEntry) -> Self {
23 Self { entry }
24 }
25}
26
27impl fmt::Display for IgnoreEntryLine<'_> {
28 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
29 write!(f, " {}", self.entry.fingerprint)?;
30 if let Some(reason) = &self.entry.reason {
31 write!(f, " (reason: {reason})")?;
32 }
33 if !self.entry.members.is_empty() {
34 write!(f, " [{}]", self.entry.members.join(", "))?;
35 }
36 Ok(())
37 }
38}