Skip to content

Instantly share code, notes, and snippets.

@bascht
Created April 29, 2015 11:46
Show Gist options
  • Select an option

  • Save bascht/72fb2f71c92b52679216 to your computer and use it in GitHub Desktop.

Select an option

Save bascht/72fb2f71c92b52679216 to your computer and use it in GitHub Desktop.
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