Skip to content

Commit 1fb08f1

Browse files
committed
libgetopts: Remove all uses of ~str from libgetopts
1 parent 28bcef8 commit 1fb08f1

File tree

8 files changed

+275
-248
lines changed

8 files changed

+275
-248
lines changed

src/compiletest/compiletest.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config {
101101
}
102102

103103
let matches =
104-
&match getopts::getopts(args_.iter()
105-
.map(|x| x.to_owned())
106-
.collect::<Vec<_>>()
107-
.as_slice(),
108-
groups.as_slice()) {
104+
&match getopts::getopts(args_.as_slice(), groups.as_slice()) {
109105
Ok(m) => m,
110106
Err(f) => fail!("{}", f.to_err_msg())
111107
};
@@ -146,15 +142,18 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config {
146142
build_base: opt_path(matches, "build-base"),
147143
aux_base: opt_path(matches, "aux-base"),
148144
stage_id: matches.opt_str("stage-id").unwrap().to_strbuf(),
149-
mode: FromStr::from_str(matches.opt_str("mode").unwrap()).expect("invalid mode"),
145+
mode: FromStr::from_str(matches.opt_str("mode")
146+
.unwrap()
147+
.as_slice()).expect("invalid mode"),
150148
run_ignored: matches.opt_present("ignored"),
151149
filter: filter,
152150
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
153151
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
154152
ratchet_metrics:
155153
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
156154
ratchet_noise_percent:
157-
matches.opt_str("ratchet-noise-percent").and_then(|s| from_str::<f64>(s)),
155+
matches.opt_str("ratchet-noise-percent")
156+
.and_then(|s| from_str::<f64>(s.as_slice())),
158157
runtool: matches.opt_str("runtool").map(|x| x.to_strbuf()),
159158
host_rustcflags: matches.opt_str("host-rustcflags")
160159
.map(|x| x.to_strbuf()),

0 commit comments

Comments
 (0)