-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move color coding logic into the formatter
- Loading branch information
1 parent
010e96c
commit a5196a7
Showing
5 changed files
with
77 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use std::fmt::Display; | ||
|
||
use crate::error::Error; | ||
impl From<rustls::Error> for Error { | ||
fn from(error: rustls::Error) -> Self { | ||
Error::new("TLS Error").description(error.to_string()) | ||
} | ||
} | ||
|
||
impl Display for crate::error::Error { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
self.pretty_print(f, true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,14 @@ | ||
mod command; | ||
|
||
pub mod error; | ||
mod fmt; | ||
#[cfg(feature = "js")] | ||
pub mod javascript; | ||
pub mod metrics; | ||
pub mod runtime; | ||
pub mod server; | ||
mod tc; | ||
pub mod telemetry; | ||
|
||
pub mod runtime; | ||
pub(crate) mod update_checker; | ||
|
||
pub use tc::run; | ||
|
||
use crate::error::Error; | ||
impl From<rustls::Error> for Error { | ||
fn from(error: rustls::Error) -> Self { | ||
let cli_error = Error::new("Failed to create TLS Acceptor"); | ||
let message = error.to_string(); | ||
|
||
cli_error.description(message) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters