diff options
| author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-07-12 22:58:45 -0400 | 
|---|---|---|
| committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-07-12 22:58:45 -0400 | 
| commit | ba1ab61901e657903a34b0b0acecb81c12b5e0d0 (patch) | |
| tree | bd9052ffb3c507a1cd27254e3134632d32e6daba /src/data.rs | |
| parent | e033861befa702b9110d531c4d17b40305915ffc (diff) | |
add: Request logging (enabled with RUST_LOG=logger=info)
Diffstat (limited to 'src/data.rs')
| -rw-r--r-- | src/data.rs | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/src/data.rs b/src/data.rs index c12db94..5674f92 100644 --- a/src/data.rs +++ b/src/data.rs @@ -68,15 +68,16 @@ pub fn new_quote(c: &Connection, date: &str, author: &str, content: &str) -> Res      Ok(())  } -pub fn new_vote(c: &Connection, quote_id: i64, score: i32) -> Result<()>{ -   c.execute( -       r#" +pub fn new_vote(c: &Connection, quote_id: i64, score: i32) -> Result<()> { +    c.execute( +        r#"             INSERT INTO votes (quote_id, score) VALUES             (?1, ?2)         "#, -       &["e_id, &score])?; -       info!("New vote: quote_id({}) score({})", quote_id, score); -       Ok(()) +        &["e_id, &score], +    )?; +    info!("New vote: quote_id({}) score({})", quote_id, score); +    Ok(())  }  pub fn approve_quote(c: &Connection, quote_id: i64) -> Result<()> { | 
