From 06b2905ee1cea6a693d45de74971e8431cec693f Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 8 Nov 2013 16:20:25 -0800 Subject: [PATCH] extra / rustpkg: Make getopts::opt_val private again and use opt_str instead of opt_val in rustpkg Closes #9311 --- src/libextra/getopts.rs | 8 ++------ src/librustpkg/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index 38b4d83fe0b..e2ace841dec 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -185,18 +185,14 @@ impl Name { } impl Matches { - /// FIXME: #9311 This used to be private, but rustpkg somehow managed to depend on it. - /// No idea what this does. - pub fn opt_vals(&self, nm: &str) -> ~[Optval] { + fn opt_vals(&self, nm: &str) -> ~[Optval] { match find_opt(self.opts, Name::from_str(nm)) { Some(id) => self.vals[id].clone(), None => fail!("No option '{}' defined", nm) } } - /// FIXME: #9311 This used to be private, but rustpkg somehow managed to depend on it. - /// No idea what this does. - pub fn opt_val(&self, nm: &str) -> Option { + fn opt_val(&self, nm: &str) -> Option { let vals = self.opt_vals(nm); if (vals.is_empty()) { None diff --git a/src/librustpkg/lib.rs b/src/librustpkg/lib.rs index b493d562b8b..55b52a012c9 100644 --- a/src/librustpkg/lib.rs +++ b/src/librustpkg/lib.rs @@ -762,7 +762,7 @@ pub fn main_args(args: &[~str]) -> int { matches.opt_present("help"); let no_link = matches.opt_present("no-link"); let no_trans = matches.opt_present("no-trans"); - let supplied_sysroot = matches.opt_val("sysroot"); + let supplied_sysroot = matches.opt_str("sysroot"); let generate_asm = matches.opt_present("S") || matches.opt_present("assembly"); let parse_only = matches.opt_present("parse-only"); @@ -894,7 +894,7 @@ pub fn main_args(args: &[~str]) -> int { let mut remaining_args: ~[~str] = remaining_args.map(|s| (*s).clone()).collect(); remaining_args.shift(); let sroot = match supplied_sysroot { - Some(getopts::Val(s)) => Path::new(s), + Some(s) => Path::new(s), _ => filesearch::get_or_default_sysroot() };