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: Applying cargo fmt to macros lib.rs #140

Merged
merged 1 commit into from
Mar 12, 2024
Merged
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
8 changes: 3 additions & 5 deletions pywr-schema-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum PywrField {
/// Generates a [`TokenStream`] containing the implementation of two methods, `parameters`
/// and `parameters_mut`, for the given struct.
///
/// Both method returns a [`HashMap`] of parameter names to [`DynamicFloatValue`]. This
/// Both method returns a [`HashMap`] of parameter names to [`DynamicFloatValue`]. This
/// is intended to be used for nodes and parameter structs in the Pywr schema.
fn impl_parameter_references_derive(ast: &syn::DeriveInput) -> TokenStream {
// Name of the node type
Expand Down Expand Up @@ -157,9 +157,7 @@ fn type_to_ident(ty: &syn::Type) -> Option<PywrField> {
// Match on path types that are no self types.
let arg_type_path = match arg_ty {
Some(ty) => match ty {
syn::Type::Path(type_path) if type_path.qself.is_none() => {
Some(type_path)
}
syn::Type::Path(type_path) if type_path.qself.is_none() => Some(type_path),
_ => None,
},
None => None,
Expand Down Expand Up @@ -195,4 +193,4 @@ fn is_parameter_ident(ident: &syn::Ident) -> bool {
// TODO this currenty omits more complex attributes, such as `factors` for AggregatedNode
// and steps for PiecewiseLinks, that can internally contain `DynamicFloatValue` fields
ident == "DynamicFloatValue"
}
}