Fix case warning on derived properties (#1929)

When deriving `Properties`, the compiler sometimes complains of the
non-Camel-case `Foo_build`. This fixes the issue.
This commit is contained in:
nitnelave 2021-06-26 17:11:09 +02:00 committed by GitHub
parent b87717ce9b
commit 2e8f52c73f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -120,7 +120,10 @@ impl PropsBuilder<'_> {
.filter(|pf| pf.is_required())
.map(|pf| pf.to_step_name(prefix))
.collect();
step_names.push(Ident::new(&format!("{}_build", prefix), Span::call_site()));
step_names.push(Ident::new(
&format!("{}PropsBuilder", prefix),
prefix.span(),
));
step_names
}

View File

@ -30,14 +30,14 @@ error[E0609]: no field `fail` on type `Props`
|
= note: available fields are: `a`
error[E0599]: no method named `fail` found for struct `PropsBuilder<PropsBuilderStep_build>` in the current scope
error[E0599]: no method named `fail` found for struct `PropsBuilder<PropsBuilderStepPropsBuilder>` in the current scope
--> $DIR/props-fail.rs:10:31
|
3 | #[derive(Clone, Properties)]
| ---------- method `fail` not found for this
...
10 | yew::props!(Props { a: 5, fail: 10 });
| ^^^^ method not found in `PropsBuilder<PropsBuilderStep_build>`
| ^^^^ method not found in `PropsBuilder<PropsBuilderStepPropsBuilder>`
error[E0609]: no field `does_not_exist` on type `Props`
--> $DIR/props-fail.rs:15:25