2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-11-10 06:25:00 +00:00

Make running pict-rs fluent

This commit is contained in:
asonix 2023-07-22 12:39:39 -05:00
parent 3ca994ee31
commit a390b21df1
2 changed files with 7 additions and 5 deletions

View file

@ -1531,8 +1531,9 @@ impl PictRsConfiguration {
/// ///
/// This is probably not useful for 3rd party applications that install their own tracing /// This is probably not useful for 3rd party applications that install their own tracing
/// subscribers. /// subscribers.
pub fn install_tracing(&self) -> color_eyre::Result<()> { pub fn install_tracing(self) -> color_eyre::Result<Self> {
init_tracing(&self.config.tracing) init_tracing(&self.config.tracing)?;
Ok(self)
} }
/// Run the pict-rs application /// Run the pict-rs application

View file

@ -1,6 +1,7 @@
#[actix_rt::main] #[actix_rt::main]
async fn main() -> color_eyre::Result<()> { async fn main() -> color_eyre::Result<()> {
let pict_rs = pict_rs::PictRsConfiguration::build_default()?; pict_rs::PictRsConfiguration::build_default()?
pict_rs.install_tracing()?; .install_tracing()?
pict_rs.run().await .run()
.await
} }