Skip to content

Commit

Permalink
chore: update attribute-derive (#2438)
Browse files Browse the repository at this point in the history
  • Loading branch information
ModProg authored Mar 18, 2024
1 parent 97fd8ff commit 4e578e3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion leptos_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rust-version.workspace = true
proc-macro = true

[dependencies]
attribute-derive = { version = "0.8", features = ["syn-full"] }
attribute-derive = { version = "0.9", features = ["syn-full"]}
cfg-if = "1"
html-escape = "0.2"
itertools = "0.12"
Expand Down
4 changes: 2 additions & 2 deletions leptos_macro/src/component.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use attribute_derive::Attribute as AttributeDerive;
use attribute_derive::FromAttr;
use convert_case::{
Case::{Pascal, Snake},
Casing,
Expand Down Expand Up @@ -808,7 +808,7 @@ impl Docs {
}
}

#[derive(Clone, Debug, AttributeDerive)]
#[derive(Clone, Debug, FromAttr)]
#[attribute(ident = prop)]
struct PropOpt {
#[attribute(conflicts = [optional_no_strip, strip_option])]
Expand Down
4 changes: 2 additions & 2 deletions leptos_macro/src/slot.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::component::{
convert_from_snake_case, drain_filter, is_option, unwrap_option, Docs,
};
use attribute_derive::Attribute as AttributeDerive;
use attribute_derive::FromAttr;
use proc_macro2::{Ident, TokenStream};
use quote::{quote, ToTokens, TokenStreamExt};
use syn::{
Expand Down Expand Up @@ -179,7 +179,7 @@ impl Prop {
}
}

#[derive(Clone, Debug, AttributeDerive)]
#[derive(Clone, Debug, FromAttr)]
#[attribute(ident = prop)]
struct PropOpt {
#[attribute(conflicts = [optional_no_strip, strip_option])]
Expand Down
6 changes: 4 additions & 2 deletions leptos_macro/tests/ui/component.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ error: `optional_no_strip` conflicts with mutually exclusive `strip_option`
30 | #[prop(optional_no_strip, strip_option)] conflicting: bool,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unexpected end of input, expected assignment `=`
error: unexpected end of input, expected `=` or `(`

= help: try `#[prop(default = 5 * 10)]`
--> tests/ui/component.rs:36:40
|
36 | fn default_without_value(#[prop(default)] default: bool) -> impl IntoView {
| ^

error: unexpected end of input, expected one of: identifier, `::`, `<`, `_`, literal, `const`, `ref`, `mut`, `&`, parentheses, square brackets, `..`, `const`

= help: try `#[prop(default=5 * 10)]`
= help: try `#[prop(default = 5 * 10)]`
--> tests/ui/component.rs:42:22
|
42 | #[prop(default= |)] default: bool,
Expand Down
6 changes: 4 additions & 2 deletions leptos_macro/tests/ui/component_absolute.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ error: `optional_no_strip` conflicts with mutually exclusive `strip_option`
25 | #[prop(optional_no_strip, strip_option)] conflicting: bool,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unexpected end of input, expected assignment `=`
error: unexpected end of input, expected `=` or `(`

= help: try `#[prop(default = 5 * 10)]`
--> tests/ui/component_absolute.rs:32:19
|
32 | #[prop(default)] default: bool,
| ^

error: unexpected end of input, expected one of: identifier, `::`, `<`, `_`, literal, `const`, `ref`, `mut`, `&`, parentheses, square brackets, `..`, `const`

= help: try `#[prop(default=5 * 10)]`
= help: try `#[prop(default = 5 * 10)]`
--> tests/ui/component_absolute.rs:39:22
|
39 | #[prop(default= |)] default: bool,
Expand Down

0 comments on commit 4e578e3

Please sign in to comment.