Fix displaying preferred user IDs.

- During the refactoring, some `PreferredUserID`s were displayed
    using the debug formatting.  To prevent that, take away the impl
    fmt::Debug, and adjust the format strings.

  - Fixes 367e71722f.
This commit is contained in:
Justus Winter 2024-12-16 14:49:11 +01:00
parent c528091a88
commit 58a88499ea
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386
2 changed files with 8 additions and 8 deletions

View File

@ -258,7 +258,7 @@ impl<'c, 'store, 'rstore> VHelper<'c, 'store, 'rstore> {
prefix = " ";
// Web of trust.
qprintln!("Authenticating {} ({:?}) using the web of trust:",
qprintln!("Authenticating {} ({}) using the web of trust:",
cert_fpr, signer_userid);
if let Some(cert_store) = self.sq.cert_store()? {
@ -377,23 +377,23 @@ impl<'c, 'store, 'rstore> VHelper<'c, 'store, 'rstore> {
match (level == 0, authenticated) {
(true, true) => {
weprintln!(indent=prefix,
"Authenticated signature made by {} ({:?})",
"Authenticated signature made by {} ({})",
label, signer_userid);
}
(false, true) => {
weprintln!(indent=prefix,
"Authenticated level {} notarization \
made by {} ({:?})",
made by {} ({})",
level, label, signer_userid);
}
(true, false) => {
weprintln!(indent=prefix,
"Can't authenticate signature made by {} ({:?}): \
"Can't authenticate signature made by {} ({}): \
the certificate can't be authenticated.",
label, signer_userid);
self.sq.hint(format_args!(
"After checking that {} belongs to {:?}, \
"After checking that {} belongs to {}, \
you can mark it as authenticated using:",
cert_fpr, signer_userid))
.sq().arg("pki").arg("link").arg("add")
@ -404,12 +404,12 @@ impl<'c, 'store, 'rstore> VHelper<'c, 'store, 'rstore> {
(false, false) => {
weprintln!(indent=prefix,
"Can't authenticate level {} notarization \
made by {} ({:?}): the certificate \
made by {} ({}): the certificate \
can't be authenticated.",
level, label, signer_userid);
self.sq.hint(format_args!(
"After checking that {} belongs to {:?}, \
"After checking that {} belongs to {}, \
you can mark it as authenticated using:",
cert_fpr, signer_userid))
.sq().arg("pki").arg("link").arg("add")

View File

@ -47,7 +47,7 @@ enum UserIDLike {
/// ```text
/// format!("{:.70}", userid);
/// ```
#[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq)]
#[derive(Clone, PartialOrd, Ord, PartialEq, Eq)]
pub struct PreferredUserID {
userid: UserIDLike,
trust_amount: usize,