Skip to content

fix typos #921

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

Merged
merged 1 commit into from
May 13, 2016
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use utils::span_lint;
/// **What it does:** Check for functions with too many parameters.
///
/// **Why is this bad?** Functions with lots of parameters are considered bad style and reduce
/// readability (“what does the 5th parameter means?”). Consider grouping some parameters into a
/// readability (“what does the 5th parameter mean?”). Consider grouping some parameters into a
/// new type.
///
/// **Known problems:** None.
Expand Down Expand Up @@ -70,7 +70,7 @@ impl Functions {
span_lint(cx,
TOO_MANY_ARGUMENTS,
span,
&format!("this function has to many arguments ({}/{})", args, self.threshold));
&format!("this function has too many arguments ({}/{})", args, self.threshold));
}
}
}
6 changes: 3 additions & 3 deletions tests/compile-fail/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}

fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {
//~^ ERROR: this function has to many arguments (8/7)
//~^ ERROR: this function has too many arguments (8/7)
}

trait Foo {
fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool);
fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
//~^ ERROR: this function has to many arguments (8/7)
//~^ ERROR: this function has too many arguments (8/7)
}

struct Bar;

impl Bar {
fn good_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
//~^ ERROR: this function has to many arguments (8/7)
//~^ ERROR: this function has too many arguments (8/7)
}

// ok, we don’t want to warn implementations
Expand Down