[2016][rust][9.0] base case

profile
Alpha Chen 8 years ago
parent 143f149736
commit e1128f8bca

File diff suppressed because one or more lines are too long

@ -0,0 +1,37 @@
use std::str;
use errors::*;
pub fn solve(_: &str) -> Result<String> {
Ok("".into())
}
struct Decompress<'a> {
chars: str::Chars<'a>,
}
impl<'a> Decompress<'a> {
fn new(input: &'a str) -> Self {
Decompress{chars: input.chars()}
}
}
impl<'a> Iterator for Decompress<'a> {
type Item = char;
fn next(&mut self) -> Option<char> {
self.chars.next()
}
}
#[cfg(test)]
mod tests {
use super::Decompress;
#[test]
fn test_no_markers() {
let mut decompress = Decompress::new("ADVENT");
let output: String = decompress.collect();
assert_eq!(output, "ADVENT");
}
}

@ -15,4 +15,5 @@ pub mod day_05;
pub mod day_06; pub mod day_06;
pub mod day_07; pub mod day_07;
pub mod day_08; pub mod day_08;
pub mod day_10; pub mod day_09;
// pub mod day_10;

@ -10,7 +10,7 @@ fn main() {
let mut input = String::new(); let mut input = String::new();
io::stdin().read_to_string(&mut input).ok(); io::stdin().read_to_string(&mut input).ok();
let solution = day_10::solve(&input)?; let solution = day_09::solve(&input)?;
println!("{}", solution); println!("{}", solution);
Ok(()) Ok(())

Loading…
Cancel
Save