Skip to content

Commit 5e051dd

Browse files
Use dep syntax with getopts
By using `dep:getopts`, there isn't a need to rename the package to `getopts_dep`.
1 parent 8388802 commit 5e051dd

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

timely/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ license = "MIT"
1616

1717
[features]
1818
default = ["getopts"]
19-
getopts = ["getopts-dep", "timely_communication/getopts"]
19+
getopts = ["dep:getopts", "timely_communication/getopts"]
2020

2121
[dependencies]
22-
getopts-dep = { package = "getopts", version = "0.2.14", optional = true }
22+
getopts = { version = "0.2.14", optional = true }
2323
bincode = { version = "1.0" }
2424
serde = { version = "1.0", features = ["derive"] }
2525
timely_bytes = { path = "../bytes", version = "0.12" }

timely/src/execute.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct Config {
1515
}
1616

1717
impl Config {
18-
/// Installs options into a [getopts_dep::Options] struct that correspond
18+
/// Installs options into a [getopts::Options] struct that correspond
1919
/// to the parameters in the configuration.
2020
///
2121
/// It is the caller's responsibility to ensure that the installed options
@@ -25,21 +25,21 @@ impl Config {
2525
/// This method is only available if the `getopts` feature is enabled, which
2626
/// it is by default.
2727
#[cfg(feature = "getopts")]
28-
pub fn install_options(opts: &mut getopts_dep::Options) {
28+
pub fn install_options(opts: &mut getopts::Options) {
2929
CommunicationConfig::install_options(opts);
3030
WorkerConfig::install_options(opts);
3131
}
3232

3333
/// Instantiates a configuration based upon the parsed options in `matches`.
3434
///
3535
/// The `matches` object must have been constructed from a
36-
/// [getopts_dep::Options] which contained at least the options installed by
36+
/// [getopts::Options] which contained at least the options installed by
3737
/// [Self::install_options].
3838
///
3939
/// This method is only available if the `getopts` feature is enabled, which
4040
/// it is by default.
4141
#[cfg(feature = "getopts")]
42-
pub fn from_matches(matches: &getopts_dep::Matches) -> Result<Config, String> {
42+
pub fn from_matches(matches: &getopts::Matches) -> Result<Config, String> {
4343
Ok(Config {
4444
communication: CommunicationConfig::from_matches(matches)?,
4545
worker: WorkerConfig::from_matches(matches)?,
@@ -51,7 +51,7 @@ impl Config {
5151
/// Most commonly, callers supply `std::env::args()` as the iterator.
5252
#[cfg(feature = "getopts")]
5353
pub fn from_args<I: Iterator<Item=String>>(args: I) -> Result<Config, String> {
54-
let mut opts = getopts_dep::Options::new();
54+
let mut opts = getopts::Options::new();
5555
Config::install_options(&mut opts);
5656
let matches = opts.parse(args).map_err(|e| e.to_string())?;
5757
Config::from_matches(&matches)

timely/src/worker.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub struct Config {
9292
}
9393

9494
impl Config {
95-
/// Installs options into a [getopts_dep::Options] struct that correspond
95+
/// Installs options into a [getopts::Options] struct that correspond
9696
/// to the parameters in the configuration.
9797
///
9898
/// It is the caller's responsibility to ensure that the installed options
@@ -102,20 +102,20 @@ impl Config {
102102
/// This method is only available if the `getopts` feature is enabled, which
103103
/// it is by default.
104104
#[cfg(feature = "getopts")]
105-
pub fn install_options(opts: &mut getopts_dep::Options) {
105+
pub fn install_options(opts: &mut getopts::Options) {
106106
opts.optopt("", "progress-mode", "progress tracking mode (eager or demand)", "MODE");
107107
}
108108

109109
/// Instantiates a configuration based upon the parsed options in `matches`.
110110
///
111111
/// The `matches` object must have been constructed from a
112-
/// [getopts_dep::Options] which contained at least the options installed by
112+
/// [getopts::Options] which contained at least the options installed by
113113
/// [Self::install_options].
114114
///
115115
/// This method is only available if the `getopts` feature is enabled, which
116116
/// it is by default.
117117
#[cfg(feature = "getopts")]
118-
pub fn from_matches(matches: &getopts_dep::Matches) -> Result<Config, String> {
118+
pub fn from_matches(matches: &getopts::Matches) -> Result<Config, String> {
119119
let progress_mode = matches
120120
.opt_get_default("progress-mode", ProgressMode::Eager)?;
121121
Ok(Config::default().progress_mode(progress_mode))

0 commit comments

Comments
 (0)