mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-24 09:04:19 +02:00
impl Display for TlsBackend
This commit is contained in:
parent
a8ce91ebf1
commit
9d93da0540
2 changed files with 20 additions and 1 deletions
|
|
@ -474,6 +474,25 @@ impl TryFrom<RawTlsBackend> for TlsBackend {
|
|||
}
|
||||
}
|
||||
|
||||
impl TlsBackend {
|
||||
const fn as_raw(self) -> RawTlsBackend {
|
||||
match self {
|
||||
#[cfg(feature = "native-tls")]
|
||||
Self::NativeTls => RawTlsBackend::NativeTls,
|
||||
#[cfg(feature = "rustls-with-webpki-roots")]
|
||||
Self::RustlsWithWebpkiRoots => RawTlsBackend::RustlsWithWebpkiRoots,
|
||||
#[cfg(feature = "rustls-with-native-roots")]
|
||||
Self::RustlsWithNativeRoots => RawTlsBackend::RustlsWithNativeRoots,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for TlsBackend {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.as_raw().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Config<'a> {
|
||||
pub style: StyleConfig,
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ fn try_main(args: Cli, enable_styles: bool) -> Result<ExitCode> {
|
|||
eprintln!();
|
||||
eprintln!("Note: Update errors are often caused by unexpected or missing TLS certificates.");
|
||||
eprintln!(
|
||||
"You are currently using the following TLS backend: {:?}",
|
||||
"You are currently using the following TLS backend: {}",
|
||||
config.updates.tls_backend,
|
||||
);
|
||||
eprintln!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue