Last active
December 18, 2015 20:28
-
-
Save m10e/5840213 to your computer and use it in GitHub Desktop.
rustc disapproves.
once_entry.rs:40:16: 40:61 error: mismatched types: expected `~str` but found `&str` (str storage differs: expected ~ but found &)
once_entry.rs:40 adj_str = adj_str.slice_chars(1, adj_str.char_len()-1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn parse(munny: &Munny, day: &time::Tm, tokens: &mut ~[~str]) { | |
if tokens.len() < 1 { | |
fail!("Too few arguments!") | |
} | |
// Pop adjustment string. | |
let mut set = false; | |
let mut adj_str = vec::pop(tokens); | |
// See if there's a '=' preceding it. If so, note that and slice it. | |
if adj_str.starts_with("=") { | |
set = true; | |
adj_str = adj_str.slice_chars(1, adj_str.char_len()-1); | |
} | |
// Parse adjustment amount. | |
match f64::from_str(adj_str) { | |
Some(adj) => { fail!("FIXME"); } | |
None => { fail!("Once adjustment not a proper f64!"); } | |
} | |
// Create Once instance and add to entries set. | |
fail!(~"FIXME"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment