Updated std::Option, std::Either and std::Result
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
This commit is contained in:
parent
d8b299d179
commit
0ac7a219f0
115 changed files with 803 additions and 828 deletions
|
@ -131,7 +131,7 @@ pub fn parse_config(args: ~[~str]) -> config {
|
|||
ratchet_noise_percent:
|
||||
getopts::opt_maybe_str(matches,
|
||||
"ratchet-noise-percent").map(|s|
|
||||
f64::from_str(*s).get()),
|
||||
f64::from_str(*s).unwrap()),
|
||||
runtool: getopts::opt_maybe_str(matches, "runtool"),
|
||||
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
|
||||
jit: getopts::opt_present(matches, "jit"),
|
||||
|
@ -267,7 +267,7 @@ pub fn is_test(config: &config, testfile: &Path) -> bool {
|
|||
_ => ~[~".rc", ~".rs"]
|
||||
};
|
||||
let invalid_prefixes = ~[~".", ~"#", ~"~"];
|
||||
let name = testfile.filename().get();
|
||||
let name = testfile.filename().unwrap();
|
||||
|
||||
let mut valid = false;
|
||||
|
||||
|
@ -300,7 +300,7 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
|
|||
fn shorten(path: &Path) -> ~str {
|
||||
let filename = path.filename();
|
||||
let dir = path.pop().filename();
|
||||
fmt!("%s/%s", dir.get_or_default(~""), filename.get_or_default(~""))
|
||||
fmt!("%s/%s", dir.unwrap_or_default(~""), filename.unwrap_or_default(~""))
|
||||
}
|
||||
|
||||
test::DynTestName(fmt!("[%s] %s",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue