Skip to content

Commit 5c29ea3

Browse files
committed
Eliminate html_root_url
This hasn't been needed for a long time [1]. [1]: rust-lang/api-guidelines#229
1 parent 439fb81 commit 5c29ea3

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "getopts"
3-
version = "0.2.21" # don't forget to update html_root_url
3+
version = "0.2.21"
44
authors = ["The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

src/lib.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@
9696
9797
#![doc(
9898
html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
99-
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
100-
html_root_url = "https://docs.rs/getopts/0.2.21"
99+
html_favicon_url = "https://www.rust-lang.org/favicon.ico"
101100
)]
102101
#![deny(missing_docs)]
103102
#![cfg_attr(test, deny(warnings))]
@@ -529,9 +528,7 @@ impl Options {
529528
// FloatingFrees is in use.
530529
if let Some(i_arg) = i_arg.take() {
531530
vals[opt_id].push((arg_pos, Val(i_arg)));
532-
} else if was_long
533-
|| args.peek().map_or(true, |n| is_arg(&n))
534-
{
531+
} else if was_long || args.peek().map_or(true, |n| is_arg(&n)) {
535532
vals[opt_id].push((arg_pos, Given));
536533
} else {
537534
vals[opt_id].push((arg_pos, Val(args.next().unwrap())));
@@ -565,7 +562,12 @@ impl Options {
565562
// in option does not exist in `free` and must be replaced with `None`
566563
args_end = args_end.filter(|pos| pos != &free.len());
567564

568-
Ok(Matches { opts, vals, free, args_end })
565+
Ok(Matches {
566+
opts,
567+
vals,
568+
free,
569+
args_end,
570+
})
569571
}
570572

571573
/// Derive a short one-line usage summary from a set of long options.
@@ -915,7 +917,10 @@ impl Matches {
915917
///
916918
/// This function will panic if the option name is not defined.
917919
pub fn opt_positions(&self, name: &str) -> Vec<usize> {
918-
self.opt_vals(name).into_iter().map(|(pos, _)| pos).collect()
920+
self.opt_vals(name)
921+
.into_iter()
922+
.map(|(pos, _)| pos)
923+
.collect()
919924
}
920925

921926
/// Returns true if any of several options were matched.

0 commit comments

Comments
 (0)