Skip to content

Commit 06b2905

Browse files
committed
extra / rustpkg: Make getopts::opt_val private again
and use opt_str instead of opt_val in rustpkg Closes #9311
1 parent a594a99 commit 06b2905

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
@@ -762,7 +762,7 @@ pub fn main_args(args: &[~str]) -> int {
762762
matches.opt_present("help");
763763
let no_link = matches.opt_present("no-link");
764764
let no_trans = matches.opt_present("no-trans");
765-
let supplied_sysroot = matches.opt_val("sysroot");
765+
let supplied_sysroot = matches.opt_str("sysroot");
766766
let generate_asm = matches.opt_present("S") ||
767767
matches.opt_present("assembly");
768768
let parse_only = matches.opt_present("parse-only");
@@ -894,7 +894,7 @@ pub fn main_args(args: &[~str]) -> int {
894894
let mut remaining_args: ~[~str] = remaining_args.map(|s| (*s).clone()).collect();
895895
remaining_args.shift();
896896
let sroot = match supplied_sysroot {
897-
Some(getopts::Val(s)) => Path::new(s),
897+
Some(s) => Path::new(s),
898898
_ => filesearch::get_or_default_sysroot()
899899
};
900900

0 commit comments

Comments
 (0)