diff --git a/src/lib.rs b/src/lib.rs index 13cc129..5e878f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,7 +43,7 @@ impl Echobox { while let Some(row) = cursor.next().unwrap() { quotes.push(Quote { id: row[0].as_integer().expect("Expected rowid in row"), - text: String::from(row[1].as_string().expect("Expected text in row")) + content: String::from(row[1].as_string().expect("Expected content in row")) }); } Result::Ok(quotes) @@ -64,11 +64,11 @@ impl From for Error { #[derive(Debug, Clone)] pub struct Quote { pub id: i64, - pub text: String + pub content: String } impl std::fmt::Display for Quote { fn fmt (&self, formatter: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { - write!(formatter, "{}", self.text) + write!(formatter, "{}", self.content) } } diff --git a/src/main.rs b/src/main.rs index f5105d2..9acf14f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,5 +15,5 @@ fn main () { let in_quote = &env::args().nth(1).expect("Expected quote as first argument.")[..]; let echobox = Echobox::with_file(ECHOBOX_FILE).unwrap(); let out_quote = echobox.echo(in_quote).unwrap(); - println!("{}: {}", out_quote.id, out_quote.text); + println!("{}: {}", out_quote.id, out_quote.content); }