Skip to content

extra / rustpkg: Make getopts::opt_val private again #10372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/libextra/getopts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Optval> {
fn opt_val(&self, nm: &str) -> Option<Optval> {
let vals = self.opt_vals(nm);
if (vals.is_empty()) {
None
Expand Down
4 changes: 2 additions & 2 deletions src/librustpkg/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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()
};

Expand Down