From 4a59dce1cdd371c86d1b4453bb5884d9344442d8 Mon Sep 17 00:00:00 2001 From: Jokler Date: Thu, 31 Oct 2019 01:29:40 +0100 Subject: Quote: Fix info message and adjust get output --- src/plugins/quote/database.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/plugins/quote/database.rs') diff --git a/src/plugins/quote/database.rs b/src/plugins/quote/database.rs index c8f550e..3c904df 100644 --- a/src/plugins/quote/database.rs +++ b/src/plugins/quote/database.rs @@ -81,7 +81,9 @@ impl Database .iter() .filter(|&(&(_, ref c, _), _)| c == channel) .nth(idx as usize - 1) - .ok_or(ErrorKind::NotFound)?.1.clone()) + .ok_or(ErrorKind::NotFound)? + .1 + .clone()) } fn count_user_quotes(&self, quotee: &str, channel: &str) -> Result { @@ -121,7 +123,6 @@ use self::schema::quotes; #[cfg(feature = "mysql")] impl Database for Arc>> { fn insert_quote(&mut self, quote: &NewQuote) -> Result<(), QuoteError> { - let conn = &*self.get().context(ErrorKind::NoConnection)?; diesel::insert_into(quotes::table) .values(quote) @@ -149,7 +150,6 @@ impl Database for Arc>> { } fn count_user_quotes(&self, quotee: &str, channel: &str) -> Result { - let conn = &*self.get().context(ErrorKind::NoConnection)?; let count: Result = quotes::table .filter(quotes::columns::quotee.eq(quotee)) @@ -165,7 +165,6 @@ impl Database for Arc>> { } fn count_channel_quotes(&self, channel: &str) -> Result { - let conn = &*self.get().context(ErrorKind::NoConnection)?; let count: Result = quotes::table .filter(quotes::columns::channel.eq(channel)) -- cgit v1.2.3-70-g09d2