Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza1311 committed Sep 25, 2022
1 parent 0ef4919 commit b6fdd17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/yew-macro/src/props/prop_macro.rs
Expand Up @@ -8,7 +8,7 @@ use syn::spanned::Spanned;
use syn::token::Brace;
use syn::{Expr, Token, TypePath};

use super::{ComponentProps, Prop, Props, PropList};
use super::{ComponentProps, Prop, PropList, Props};
use crate::html_tree::HtmlDashedName;

/// Pop from `Punctuated` without leaving it in a state where it has trailing punctuation.
Expand Down
12 changes: 10 additions & 2 deletions packages/yew-macro/tests/props_macro_test.rs
Expand Up @@ -9,10 +9,18 @@ fn props_macro() {
#[test]
fn props_order() {
#[derive(yew::Properties, PartialEq)]
struct Props { first: usize, second: usize, last: usize }
struct Props {
first: usize,
second: usize,
last: usize,
}

let mut g = 1..=3;
let props = yew::props!(Props { first: g.next().unwrap(), second: g.next().unwrap(), last: g.next().unwrap() });
let props = yew::props!(Props {
first: g.next().unwrap(),
second: g.next().unwrap(),
last: g.next().unwrap()
});

assert_eq!(props.first, 1);
assert_eq!(props.second, 2);
Expand Down

0 comments on commit b6fdd17

Please sign in to comment.