Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldSEnder committed Jun 19, 2022
1 parent 38092c0 commit 6665f48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/yew-macro/src/derive_props/field.rs
Expand Up @@ -39,12 +39,12 @@ impl PropField {

/// This check name is descriptive to help a developer realize they missed a required prop
fn to_check_name(&self, props_name: &Ident) -> Ident {
format_ident!("Has{}{}", props_name, self.name, span = Span::mixed_site(),)
format_ident!("Has{}{}", props_name, self.name, span = Span::mixed_site())
}

/// This check name is descriptive to help a developer realize they missed a required prop
fn to_check_arg_name(&self, props_name: &Ident) -> GenericParam {
let ident = format_ident!("How{}{}", props_name, self.name, span = Span::mixed_site(),);
let ident = format_ident!("How{}{}", props_name, self.name, span = Span::mixed_site());
GenericParam::Type(ident.into())
}

Expand Down
7 changes: 5 additions & 2 deletions packages/yew/src/html/component/properties.rs
Expand Up @@ -11,7 +11,8 @@ pub trait Properties: PartialEq {
fn builder() -> Self::Builder;
}

mod macro_export {
#[doc(hidden)]
mod __macro {
/// A marker trait to ensure that the builder has received a specific required prop.
/// For each required impl in a property, we generate:
/// - a struct with the name of the prop, which takes the place of `P`.
Expand All @@ -29,6 +30,8 @@ mod macro_export {
/// A marker trait to ensure that the builder has received all required props.
/// For each struct deriving [`Properties`], an impl is generated, requiring `HasProp<p>` for
/// all properties marked as required as a bound on the impl.
///
/// [`Properties`]: super::Properties
pub trait HasAllProps<P, How> {}

/// Trait finishing the builder and verifying all props were set.
Expand Down Expand Up @@ -113,4 +116,4 @@ mod macro_export {
}

#[doc(hidden)]
pub use macro_export::{AllPropsFor, AssertAllProps, Buildable, HasAllProps, HasProp};
pub use __macro::{AllPropsFor, AssertAllProps, Buildable, HasAllProps, HasProp};

0 comments on commit 6665f48

Please sign in to comment.