Skip to content

Commit

Permalink
fix span
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Dec 12, 2023
1 parent 2aa2a95 commit e842d16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "educe"
version = "0.5.4"
version = "0.5.5"
authors = ["Magic Len <len@magiclen.org>"]
edition = "2021"
rust-version = "1.56"
Expand Down
6 changes: 4 additions & 2 deletions src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,18 @@ pub(crate) fn educe_format_incorrect(name: &Ident) -> syn::Error {

#[inline]
pub(crate) fn unsupported_trait(name: &Path) -> syn::Error {
let span = name.span();

match name.get_ident() {
Some(name) => syn::Error::new(
name.span(),
span,
format!("unsupported trait `{}`, available traits:{}", name, DisplayTraits),
),
None => {
let name = path_to_string(name);

syn::Error::new(
name.span(),
span,
format!("unsupported trait `{}`, available traits:{}", name, DisplayTraits),
)
},
Expand Down

0 comments on commit e842d16

Please sign in to comment.