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

Rewrote extra::getopts to use methods #9267

Merged
merged 1 commit into from
Sep 19, 2013
Merged

Conversation

Kimundi
Copy link
Member

@Kimundi Kimundi commented Sep 17, 2013

No description provided.

target: opt_str2(getopts::opt_maybe_str(matches, "target")).to_str(),
adb_path: opt_str2(getopts::opt_maybe_str(matches, "adb-path")).to_str(),
matches.opt_maybe_str("ratchet-noise-percent").map_move(|s|
f64::from_str(s).unwrap()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f64::from_str is disappearing in #9275, so if this could change to from_str(s).unwrap() it'd save at least one rebase. (Also, this could be .and_then(from_str) right?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to and_then, re-testing right now. Any other lines like this?

@Kimundi
Copy link
Member Author

Kimundi commented Sep 18, 2013

Don't r+ yet, still rewriting a few things in the documentation


Ready now.

use std::vec;

/// Name of an option. Either an string or a single char.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In "Either an string", s/an/a.

@Kimundi
Copy link
Member Author

Kimundi commented Sep 19, 2013

Hm, the failure doesn't seem related to my changes.

Some minor api and doc adjustments
bors added a commit that referenced this pull request Sep 19, 2013
@bors bors closed this Sep 19, 2013
@bors bors merged commit 06d1dcc into rust-lang:master Sep 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 6, 2022
Fix sorting in ` cargo dev update_lints` script

changelog: none

The old code cloned and sorted `usable_lints` into `sorted_usable_lints`, but then failed to do anything with `sorted_usable_lints`.

This was discovered by my new `collection_is_never_read` lint (rust-lang#9267) that I'm working on!

Fix: I renamed the sorted vector to `usable_lints`.  Therefore it now gets used where the unsorted one was used previously.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 10, 2023
…llogiq

Add `collection_is_never_read`

Fixes rust-lang#9267

`@flip1995` and `@llogiq,` I talked with you about this one at Rust Nation in London last week. :-)

This is my first contribution to Clippy, so lots of feedback would be greatly appreciated.

- \[ ] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

`dogfood` found one true positive (see rust-lang#9509) and no false positives.

`lintcheck` found no (true or false) positives, even when running on an extended set of crates.

---

changelog: new lint [`collection_is_never_read`]
[rust-lang#10415](rust-lang/rust-clippy#10415)
<!-- changelog_checked -->
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.

5 participants