Skip to content

Commit dc5d9b9

Browse files
committed
auto merge of #10372 : catamorphism/rust/rustpkg-issue-9311, r=catamorphism
and use opt_str instead of opt_val in rustpkg Closes #9311
2 parents 7bb668d + 06b2905 commit dc5d9b9

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/libextra/getopts.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,14 @@ impl Name {
185185
}
186186

187187
impl Matches {
188-
/// FIXME: #9311 This used to be private, but rustpkg somehow managed to depend on it.
189-
/// No idea what this does.
190-
pub fn opt_vals(&self, nm: &str) -> ~[Optval] {
188+
fn opt_vals(&self, nm: &str) -> ~[Optval] {
191189
match find_opt(self.opts, Name::from_str(nm)) {
192190
Some(id) => self.vals[id].clone(),
193191
None => fail!("No option '{}' defined", nm)
194192
}
195193
}
196194

197-
/// FIXME: #9311 This used to be private, but rustpkg somehow managed to depend on it.
198-
/// No idea what this does.
199-
pub fn opt_val(&self, nm: &str) -> Option<Optval> {
195+
fn opt_val(&self, nm: &str) -> Option<Optval> {
200196
let vals = self.opt_vals(nm);
201197
if (vals.is_empty()) {
202198
None

src/librustpkg/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ pub fn main_args(args: &[~str]) -> int {
763763
matches.opt_present("help");
764764
let no_link = matches.opt_present("no-link");
765765
let no_trans = matches.opt_present("no-trans");
766-
let supplied_sysroot = matches.opt_val("sysroot");
766+
let supplied_sysroot = matches.opt_str("sysroot");
767767
let generate_asm = matches.opt_present("S") ||
768768
matches.opt_present("assembly");
769769
let parse_only = matches.opt_present("parse-only");
@@ -895,7 +895,7 @@ pub fn main_args(args: &[~str]) -> int {
895895
let mut remaining_args: ~[~str] = remaining_args.map(|s| (*s).clone()).collect();
896896
remaining_args.shift();
897897
let sroot = match supplied_sysroot {
898-
Some(getopts::Val(s)) => Path::new(s),
898+
Some(s) => Path::new(s),
899899
_ => filesearch::get_or_default_sysroot()
900900
};
901901

0 commit comments

Comments
 (0)