Skip to content

Commit

Permalink
Fix current build warnings
Browse files Browse the repository at this point in the history
This changes the minimum supported rustc, and that can be documented in
CI if necessary
  • Loading branch information
alexcrichton committed Aug 19, 2019
1 parent 5148159 commit 15fd785
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: CI
on: [push, pull_request]

jobs:
test:
name: Test
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ Add this to your `Cargo.toml`:
[dependencies]
getopts = "0.2"
```

## Rust Version Support

The minimum supported Rust version is 1.18.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,15 +503,15 @@ impl Options {

/// Derive a custom formatted message from a set of options. The formatted options provided to
/// a closure as an iterator.
pub fn usage_with_format<F: FnMut(&mut Iterator<Item = String>) -> String>(
pub fn usage_with_format<F: FnMut(&mut dyn Iterator<Item = String>) -> String>(
&self,
mut formatter: F,
) -> String {
formatter(&mut self.usage_items())
}

/// Derive usage items from a set of options.
fn usage_items<'a>(&'a self) -> Box<Iterator<Item = String> + 'a> {
fn usage_items<'a>(&'a self) -> Box<dyn Iterator<Item = String> + 'a> {
let desc_sep = format!("\n{}", repeat(" ").take(24).collect::<String>());

let any_short = self.grps.iter().any(|optref| !optref.short_name.is_empty());
Expand Down

0 comments on commit 15fd785

Please sign in to comment.