Created
April 29, 2015 11:46
-
-
Save bascht/72fb2f71c92b52679216 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| struct Record { | |
| company: String, | |
| address: String, | |
| email: String, | |
| } | |
| impl ToString for Record { | |
| fn to_string(&self) -> String { | |
| let mut slice = self.company.clone().truncate(3); | |
| return slice; | |
| } | |
| } | |
| // src/main.rs:14:16: 14:21 error: mismatched types: | |
| // expected `collections::string::String`, | |
| // found `()` | |
| // (expected struct `collections::string::String`, | |
| // found ()) [E0308] | |
| // src/main.rs:14 return slice; | |
| // ^~~~~ | |
| // error: aborting due to previous error | |
| // Could not compile `csv-cleanup`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment