Created
March 30, 2015 16:34
-
-
Save ostronom/6f886d739e7cd45fbb8d to your computer and use it in GitHub Desktop.
error: not all control paths return a value [E0269]. WTF?
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
use std::collections::HashMap; | |
use std::hash::Hash; | |
use std::cmp::Eq; | |
trait Transit { | |
fn tag(&self) -> &str; | |
fn rep(&self) -> String; | |
} | |
impl<K: Transit + Hash + Eq, V: Transit> Transit for HashMap<K, V> { | |
fn tag(&self) -> &str { "map" } | |
fn rep(&self) -> String { | |
String::from_str("LOLWUT?"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you haven't already sorted this out, it's the semicolon on line 15. A semicolon makes an expression into a statement.