Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update attribute-derive #2438

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading