Skip to content

Commit

Permalink
Fix spelling: occurences -> occurrences, (#158)
Browse files Browse the repository at this point in the history
was found in comments and code, but required no user-facing API change.
  • Loading branch information
florianjacob authored and TeXitoi committed Dec 22, 2018
1 parent 23e36e3 commit b4cdc47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct Opt {
#[structopt(short = "d", long = "debug")]
debug: bool,

// The number of occurences of the `v/verbose` flag
// The number of occurrences of the `v/verbose` flag
/// Verbose mode (-v, -vv, -vvv, etc.)
#[structopt(short = "v", long = "verbose", parse(from_occurrences))]
verbose: u8,
Expand Down
2 changes: 1 addition & 1 deletion examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct Opt {
#[structopt(short = "d", long = "debug")]
debug: bool,

// The number of occurences of the `v/verbose` flag
// The number of occurrences of the `v/verbose` flag
/// Verbose mode (-v, -vv, -vvv, etc.)
#[structopt(short = "v", long = "verbose", parse(from_occurrences))]
verbose: u8,
Expand Down
8 changes: 4 additions & 4 deletions structopt-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn gen_augmentation(
_ => &field.ty,
};

let occurences = attrs.parser().0 == Parser::FromOccurrences;
let occurrences = attrs.parser().0 == Parser::FromOccurrences;

let validator = match *attrs.parser() {
(Parser::TryFromStr, ref f) => quote! {
Expand All @@ -152,7 +152,7 @@ fn gen_augmentation(
Ty::Bool => quote!( .takes_value(false).multiple(false) ),
Ty::Option => quote!( .takes_value(true).multiple(false) #validator ),
Ty::Vec => quote!( .takes_value(true).multiple(true) #validator ),
Ty::Other if occurences => quote!( .takes_value(false).multiple(true) ),
Ty::Other if occurrences => quote!( .takes_value(false).multiple(true) ),
Ty::Other => {
let required = !attrs.has_method("default_value");
quote!( .takes_value(true).multiple(false).required(#required) #validator )
Expand Down Expand Up @@ -214,7 +214,7 @@ fn gen_constructor(fields: &Punctuated<Field, Comma>, parent_attribute: &Attrs)
(FromOccurrences, ref f) => (quote!(occurrences_of), quote!(), f.clone()),
};

let occurences = attrs.parser().0 == Parser::FromOccurrences;
let occurrences = attrs.parser().0 == Parser::FromOccurrences;
let name = attrs.cased_name();
let field_value = match ty {
Ty::Bool => quote!(matches.is_present(#name)),
Expand All @@ -228,7 +228,7 @@ fn gen_constructor(fields: &Punctuated<Field, Comma>, parent_attribute: &Attrs)
.map(|v| v.map(#parse).collect())
.unwrap_or_else(Vec::new)
},
Ty::Other if occurences => quote! {
Ty::Other if occurrences => quote! {
#parse(matches.#value_of(#name))
},
Ty::Other => quote! {
Expand Down

0 comments on commit b4cdc47

Please sign in to comment.