From 382c3239f25488f837304bfffb4bab26e8e72f4a Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Tue, 1 Aug 2023 02:32:01 +0200 Subject: parser: use `?` --- askama_parser/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'askama_parser/src/lib.rs') diff --git a/askama_parser/src/lib.rs b/askama_parser/src/lib.rs index bc29a22..37c1977 100644 --- a/askama_parser/src/lib.rs +++ b/askama_parser/src/lib.rs @@ -40,11 +40,7 @@ mod _parsed { // internally we will transmute it to `&'static str` to satisfy the compiler. // However, we only expose the nodes with a lifetime limited to `self`. let src = unsafe { mem::transmute::<&str, &'static str>(source.as_str()) }; - let ast = match Ast::from_str(src, syntax) { - Ok(ast) => ast, - Err(e) => return Err(e), - }; - + let ast = Ast::from_str(src, syntax)?; Ok(Self { ast, source }) } -- cgit