Skip to content

Commit

Permalink
Fix erroneous changes for error spans
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillsemyonkin committed Nov 2, 2023
1 parent 764f422 commit 3162b1d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/yew-macro/src/props/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ impl PropList {
if prop.is_some() {
if let Some(other_prop) = self.get_by_label(key) {
return Err(syn::Error::new_spanned(
// OK to unwrap since pop/get_by_label can be Some only if PropLabel::Static
String::try_from(&other_prop.label).unwrap(),
&other_prop.label,
format!("`{key}` can only be specified once"),
));
}
Expand Down Expand Up @@ -379,8 +378,7 @@ impl PropList {
pub fn check_no_duplicates(&self) -> syn::Result<()> {
crate::join_errors(self.iter_duplicates().map(|prop| {
syn::Error::new_spanned(
// OK to unwrap since iter_duplicates iterates only over PropLabel::Static
String::try_from(&prop.label).unwrap(),
&prop.label,
format!(
"`{}` can only be specified once but is given here again",
String::try_from(&prop.label).unwrap()
Expand Down

0 comments on commit 3162b1d

Please sign in to comment.