diff options
author | René Kijewski <rene.kijewski@fu-berlin.de> | 2023-08-01 02:32:01 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-08-01 10:51:57 +0200 |
commit | 382c3239f25488f837304bfffb4bab26e8e72f4a (patch) | |
tree | 88c7f56b1d82436d51419d1f3ea2b7ba2b0022ae /askama_parser | |
parent | b3843d90a85d84e44ccd6cb188a5aa375df84104 (diff) | |
download | askama-382c3239f25488f837304bfffb4bab26e8e72f4a.tar.gz askama-382c3239f25488f837304bfffb4bab26e8e72f4a.tar.bz2 askama-382c3239f25488f837304bfffb4bab26e8e72f4a.zip |
parser: use `?`
Diffstat (limited to 'askama_parser')
-rw-r--r-- | askama_parser/src/lib.rs | 6 |
1 files changed, 1 insertions, 5 deletions
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 }) } |