mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 21:20:17 +00:00
introduce the use of anyhow to no longer use panic
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::context::Context;
|
||||
use crate::context::SproutContext;
|
||||
use anyhow::Result;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -8,6 +9,7 @@ pub struct PrintConfiguration {
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
pub fn print(context: Rc<Context>, configuration: &PrintConfiguration) {
|
||||
pub fn print(context: Rc<SproutContext>, configuration: &PrintConfiguration) -> Result<()> {
|
||||
println!("{}", context.stamp(&configuration.text));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user