diff options
author | René Kijewski <kijewski@library.vetmed.fu-berlin.de> | 2022-02-03 19:20:53 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2022-02-07 09:33:22 +0100 |
commit | 0aab78c6775493fb13fabce2b5eaef7ac83e6665 (patch) | |
tree | 13d55da7969824ad2b5295f18ebd8068aebdcaed /askama_derive | |
parent | e808b2a43ece9892314f68028679ec68566b21b3 (diff) | |
download | askama-0aab78c6775493fb13fabce2b5eaef7ac83e6665.tar.gz askama-0aab78c6775493fb13fabce2b5eaef7ac83e6665.tar.bz2 askama-0aab78c6775493fb13fabce2b5eaef7ac83e6665.zip |
Enable tracking of the offending span of an error
Diffstat (limited to 'askama_derive')
-rw-r--r-- | askama_derive/src/lib.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 4d81433..2409ba4 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -9,7 +9,6 @@ use askama_shared::{ generator, get_template_source, read_config_file, CompileError, Config, Integrations, }; use proc_macro::TokenStream; -use proc_macro2::Span; use std::collections::HashMap; use std::path::PathBuf; @@ -19,9 +18,7 @@ pub fn derive_template(input: TokenStream) -> TokenStream { let ast: syn::DeriveInput = syn::parse(input).unwrap(); match build_template(&ast) { Ok(source) => source.parse().unwrap(), - Err(e) => syn::Error::new(Span::call_site(), e) - .to_compile_error() - .into(), + Err(e) => e.to_compile_error().into(), } } |