Skip to content

Clippy rustfmt #747

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
Jan 7, 2016
Merged

Clippy rustfmt #747

merged 1 commit into from
Jan 7, 2016

Conversation

Manishearth
Copy link
Member

r? @nrc

@Manishearth
Copy link
Member Author

This is the remaining clippy output. I don't know if we should rename from_str, and cyclomatic complexity lints can only be fixed by those who understand the function.

src/items.rs:1020:1: 1219:2 warning: The function has a cyclomatic complexity of 34, #[warn(cyclomatic_complexity)] on by default
src/items.rs:1020 fn rewrite_fn_base(context: &RewriteContext,
src/items.rs:1021                    indent: Indent,
src/items.rs:1022                    ident: ast::Ident,
src/items.rs:1023                    fd: &ast::FnDecl,
src/items.rs:1024                    explicit_self: Option<&ast::ExplicitSelf>,
src/items.rs:1025                    generics: &ast::Generics,
                  ...
src/items.rs:1020:1: 1219:2 help: You could split it up into multiple smaller functions
for further information visit https://github.com/Manishearth/rust-clippy/wiki#cyclomatic_complexity
src/lists.rs:140:5: 147:6 warning: defining a method called `from_str` on this type; consider implementing the `std::str::FromStr` trait or choosing a less ambiguous name, #[warn(should_implement_trait)] on by default
src/lists.rs:140     pub fn from_str<S: Into<String>>(s: S) -> ListItem {
src/lists.rs:141         ListItem {
src/lists.rs:142             pre_comment: None,
src/lists.rs:143             item: Some(s.into()),
src/lists.rs:144             post_comment: None,
src/lists.rs:145             new_lines: false,
                 ...
src/lists.rs:140:5: 147:6 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#should_implement_trait
src/lists.rs:190:1: 326:2 warning: The function has a cyclomatic complexity of 29, #[warn(cyclomatic_complexity)] on by default
src/lists.rs:190 pub fn write_list<I, T>(items: I, formatting: &ListFormatting) -> Option<String>
src/lists.rs:191     where I: IntoIterator<Item = T>,
src/lists.rs:192           T: AsRef<ListItem>
src/lists.rs:193 {
src/lists.rs:194     let tactic = formatting.tactic;
src/lists.rs:195     let sep_len = formatting.separator.len();
                 ...
src/lists.rs:190:1: 326:2 help: You could split it up into multiple smaller functions
for further information visit https://github.com/Manishearth/rust-clippy/wiki#cyclomatic_complexity
src/expr.rs:879:5: 1016:6 warning: The function has a cyclomatic complexity of 26, #[warn(cyclomatic_complexity)] on by default
src/expr.rs:879     fn rewrite(&self, context: &RewriteContext, width: usize, offset: Indent) -> Option<String> {
src/expr.rs:880         let &ast::Arm { ref attrs, ref pats, ref guard, ref body } = self;
src/expr.rs:881         let indent_str = offset.to_string(context.config);
src/expr.rs:882 
src/expr.rs:883         // FIXME this is all a bit grotty, would be nice to abstract out the
src/expr.rs:884         // treatment of attributes.
                ...
src/expr.rs:879:5: 1016:6 help: You could split it up into multiple smaller functions
for further information visit https://github.com/Manishearth/rust-clippy/wiki#cyclomatic_complexity

@nrc
Copy link
Member

nrc commented Jan 7, 2016

Looks good, thanks!

nrc added a commit that referenced this pull request Jan 7, 2016
@nrc nrc merged commit bd32589 into rust-lang:master Jan 7, 2016
@Manishearth Manishearth deleted the clippy branch January 7, 2016 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants