libgetopts: Remove all uses of ~str from libgetopts
This commit is contained in:
@@ -354,11 +354,7 @@ Test Attributes:
|
||||
pub fn parse_opts(args: &[StrBuf]) -> Option<OptRes> {
|
||||
let args_ = args.tail();
|
||||
let matches =
|
||||
match getopts::getopts(args_.iter()
|
||||
.map(|x| x.to_owned())
|
||||
.collect::<Vec<_>>()
|
||||
.as_slice(),
|
||||
optgroups().as_slice()) {
|
||||
match getopts::getopts(args_.as_slice(), optgroups().as_slice()) {
|
||||
Ok(m) => m,
|
||||
Err(f) => return Some(Err(f.to_err_msg().to_strbuf()))
|
||||
};
|
||||
@@ -388,7 +384,8 @@ pub fn parse_opts(args: &[StrBuf]) -> Option<OptRes> {
|
||||
let ratchet_metrics = ratchet_metrics.map(|s| Path::new(s));
|
||||
|
||||
let ratchet_noise_percent = matches.opt_str("ratchet-noise-percent");
|
||||
let ratchet_noise_percent = ratchet_noise_percent.map(|s| from_str::<f64>(s).unwrap());
|
||||
let ratchet_noise_percent =
|
||||
ratchet_noise_percent.map(|s| from_str::<f64>(s.as_slice()).unwrap());
|
||||
|
||||
let save_metrics = matches.opt_str("save-metrics");
|
||||
let save_metrics = save_metrics.map(|s| Path::new(s));
|
||||
|
||||
Reference in New Issue
Block a user