Skip to content

Commit

Permalink
fix typo in new function names
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume P. <TeXitoi@users.noreply.github.com>
  • Loading branch information
njeffords and TeXitoi committed Jun 24, 2021
1 parent c174294 commit c37d9c8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions structopt-derive/src/lib.rs
Expand Up @@ -755,14 +755,14 @@ fn gen_paw_impl(_: &ImplGenerics, _: &Ident, _: &TypeGenerics, _: &TokenStream)
fn split_structopt_generics_for_impl(generics: &Generics) -> (ImplGenerics, TypeGenerics, TokenStream) {
use syn::{ token::Add, TypeParamBound::Trait };

fn path_is_structop(path: &Path) -> bool {
fn path_is_structopt(path: &Path) -> bool {
path.segments.last().unwrap().ident == "StructOpt"
}

fn type_param_bounds_contains_structop(bounds: &Punctuated<TypeParamBound, Add>) -> bool {
fn type_param_bounds_contains_structopt(bounds: &Punctuated<TypeParamBound, Add>) -> bool {
for bound in bounds {
if let Trait(bound) = bound {
if path_is_structop(&bound.path) {
if path_is_structopt(&bound.path) {
return true;
}
}
Expand All @@ -775,7 +775,7 @@ fn split_structopt_generics_for_impl(generics: &Generics) -> (ImplGenerics, Type
for param in &generics.params {
if let GenericParam::Type(param) = param {
let param_ident = &param.ident;
if type_param_bounds_contains_structop(&param.bounds) {
if type_param_bounds_contains_structopt(&param.bounds) {
if !trait_bound_amendments.is_empty() {
trait_bound_amendments.extend(quote!{ , });
}
Expand All @@ -788,7 +788,7 @@ fn split_structopt_generics_for_impl(generics: &Generics) -> (ImplGenerics, Type
for predicate in &where_clause.predicates {
if let WherePredicate::Type(predicate) = predicate {
let predicate_bounded_ty = &predicate.bounded_ty;
if type_param_bounds_contains_structop(&predicate.bounds) {
if type_param_bounds_contains_structopt(&predicate.bounds) {
if !trait_bound_amendments.is_empty() {
trait_bound_amendments.extend(quote!{ , });
}
Expand Down

0 comments on commit c37d9c8

Please sign in to comment.