Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Considerable number of pedantic lints reported by clippy #131

Open
nyurik opened this issue Jul 30, 2022 · 1 comment
Open

Considerable number of pedantic lints reported by clippy #131

nyurik opened this issue Jul 30, 2022 · 1 comment

Comments

@nyurik
Copy link
Contributor

nyurik commented Jul 30, 2022

Hi, I ran cargo clippy -- -W clippy::pedantic --no-deps and it seems there are quiet a few lints being reported, some possibly more important than others. Are you interesting in a fix for any of those, or do you think they are ok to ignore? Thx!

full output
warning: redundant else block
   --> bb8/src/inner.rs:219:28
    |
219 |                       } else {
    |  ____________________________^
220 | |                         delay = max(Duration::from_millis(200), delay);
221 | |                         delay = min(self.inner.statics.connection_timeout / 2, delay * 2);
222 | |                         sleep(delay).await;
223 | |                     }
    | |_____________________^
    |
    = note: `-W clippy::redundant-else` implied by `-W clippy::pedantic`
    = help: remove the `else` block and move the contents out
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else

warning: this method could have a `#[must_use]` attribute
  --> bb8/src/api.rs:44:5
   |
44 |     pub fn builder() -> Builder<M> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn builder() -> Builder<M>`
   |
   = note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: this method could have a `#[must_use]` attribute
  --> bb8/src/api.rs:49:5
   |
49 |     pub fn state(&self) -> State {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn state(&self) -> State`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: docs for function returning `Result` missing `# Errors` section
  --> bb8/src/api.rs:54:5
   |
54 | /     pub async fn get(&self) -> Result<PooledConnection<'_, M>, RunError<M::Error>> {
55 | |         self.inner.get().await
56 | |     }
   | |_____^
   |
   = note: `-W clippy::missing-errors-doc` implied by `-W clippy::pedantic`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: docs for function returning `Result` missing `# Errors` section
  --> bb8/src/api.rs:62:5
   |
62 | /     pub async fn get_owned(&self) -> Result<PooledConnection<'static, M>, RunError<M::Error>> {
63 | |         self.inner.get_owned().await
64 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: docs for function returning `Result` missing `# Errors` section
  --> bb8/src/api.rs:72:5
   |
72 | /     pub async fn dedicated_connection(&self) -> Result<M::Connection, M::Error> {
73 | |         self.inner.connect().await
74 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:122:5
    |
122 |     pub fn new() -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new() -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: calling `api::Builder::default()` is more clear than this expression
   --> bb8/src/api.rs:123:9
    |
123 |         Default::default()
    |         ^^^^^^^^^^^^^^^^^^ help: try: `api::Builder::default()`
    |
    = note: `-W clippy::default-trait-access` implied by `-W clippy::pedantic`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:129:5
    |
129 |     pub fn max_size(mut self, max_size: u32) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn max_size(mut self, max_size: u32) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: docs for function which may panic missing `# Panics` section
   --> bb8/src/api.rs:129:5
    |
129 | /     pub fn max_size(mut self, max_size: u32) -> Builder<M> {
130 | |         assert!(max_size > 0, "max_size must be greater than zero!");
131 | |         self.max_size = max_size;
132 | |         self
133 | |     }
    | |_____^
    |
    = note: `-W clippy::missing-panics-doc` implied by `-W clippy::pedantic`
note: first possible panic found here
   --> bb8/src/api.rs:130:9
    |
130 |         assert!(max_size > 0, "max_size must be greater than zero!");
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:129:5
    |
129 | /     pub fn max_size(mut self, max_size: u32) -> Builder<M> {
130 | |         assert!(max_size > 0, "max_size must be greater than zero!");
131 | |         self.max_size = max_size;
132 | |         self
133 | |     }
    | |_____^
    |
    = note: `-W clippy::return-self-not-must-use` implied by `-W clippy::pedantic`
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:141:5
    |
141 |     pub fn min_idle(mut self, min_idle: Option<u32>) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn min_idle(mut self, min_idle: Option<u32>) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:141:5
    |
141 | /     pub fn min_idle(mut self, min_idle: Option<u32>) -> Builder<M> {
142 | |         self.min_idle = min_idle;
143 | |         self
144 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:150:5
    |
150 |     pub fn test_on_check_out(mut self, test_on_check_out: bool) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn test_on_check_out(mut self, test_on_check_out: bool) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:150:5
    |
150 | /     pub fn test_on_check_out(mut self, test_on_check_out: bool) -> Builder<M> {
151 | |         self.test_on_check_out = test_on_check_out;
152 | |         self
153 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:164:5
    |
164 |     pub fn max_lifetime(mut self, max_lifetime: Option<Duration>) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn max_lifetime(mut self, max_lifetime: Option<Duration>) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: docs for function which may panic missing `# Panics` section
   --> bb8/src/api.rs:164:5
    |
164 | /     pub fn max_lifetime(mut self, max_lifetime: Option<Duration>) -> Builder<M> {
165 | |         assert_ne!(
166 | |             max_lifetime,
167 | |             Some(Duration::from_secs(0)),
...   |
171 | |         self
172 | |     }
    | |_____^
    |
note: first possible panic found here
   --> bb8/src/api.rs:165:9
    |
165 | /         assert_ne!(
166 | |             max_lifetime,
167 | |             Some(Duration::from_secs(0)),
168 | |             "max_lifetime must be greater than zero!"
169 | |         );
    | |_________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:164:5
    |
164 | /     pub fn max_lifetime(mut self, max_lifetime: Option<Duration>) -> Builder<M> {
165 | |         assert_ne!(
166 | |             max_lifetime,
167 | |             Some(Duration::from_secs(0)),
...   |
171 | |         self
172 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:180:5
    |
180 |     pub fn idle_timeout(mut self, idle_timeout: Option<Duration>) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn idle_timeout(mut self, idle_timeout: Option<Duration>) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: docs for function which may panic missing `# Panics` section
   --> bb8/src/api.rs:180:5
    |
180 | /     pub fn idle_timeout(mut self, idle_timeout: Option<Duration>) -> Builder<M> {
181 | |         assert_ne!(
182 | |             idle_timeout,
183 | |             Some(Duration::from_secs(0)),
...   |
187 | |         self
188 | |     }
    | |_____^
    |
note: first possible panic found here
   --> bb8/src/api.rs:181:9
    |
181 | /         assert_ne!(
182 | |             idle_timeout,
183 | |             Some(Duration::from_secs(0)),
184 | |             "idle_timeout must be greater than zero!"
185 | |         );
    | |_________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:180:5
    |
180 | /     pub fn idle_timeout(mut self, idle_timeout: Option<Duration>) -> Builder<M> {
181 | |         assert_ne!(
182 | |             idle_timeout,
183 | |             Some(Duration::from_secs(0)),
...   |
187 | |         self
188 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:196:5
    |
196 |     pub fn connection_timeout(mut self, connection_timeout: Duration) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn connection_timeout(mut self, connection_timeout: Duration) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: docs for function which may panic missing `# Panics` section
   --> bb8/src/api.rs:196:5
    |
196 | /     pub fn connection_timeout(mut self, connection_timeout: Duration) -> Builder<M> {
197 | |         assert!(
198 | |             connection_timeout > Duration::from_secs(0),
199 | |             "connection_timeout must be non-zero"
...   |
202 | |         self
203 | |     }
    | |_____^
    |
note: first possible panic found here
   --> bb8/src/api.rs:197:9
    |
197 | /         assert!(
198 | |             connection_timeout > Duration::from_secs(0),
199 | |             "connection_timeout must be non-zero"
200 | |         );
    | |_________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:196:5
    |
196 | /     pub fn connection_timeout(mut self, connection_timeout: Duration) -> Builder<M> {
197 | |         assert!(
198 | |             connection_timeout > Duration::from_secs(0),
199 | |             "connection_timeout must be non-zero"
...   |
202 | |         self
203 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:209:5
    |
209 |     pub fn error_sink(mut self, error_sink: Box<dyn ErrorSink<M::Error>>) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn error_sink(mut self, error_sink: Box<dyn ErrorSink<M::Error>>) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:209:5
    |
209 | /     pub fn error_sink(mut self, error_sink: Box<dyn ErrorSink<M::Error>>) -> Builder<M> {
210 | |         self.error_sink = error_sink;
211 | |         self
212 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:216:5
    |
216 |     pub fn reaper_rate(mut self, reaper_rate: Duration) -> Builder<M> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn reaper_rate(mut self, reaper_rate: Duration) -> Builder<M>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:216:5
    |
216 | /     pub fn reaper_rate(mut self, reaper_rate: Duration) -> Builder<M> {
217 | |         self.reaper_rate = reaper_rate;
218 | |         self
219 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: this method could have a `#[must_use]` attribute
   --> bb8/src/api.rs:222:5
    |
222 | /     pub fn connection_customizer(
223 | |         mut self,
224 | |         connection_customizer: Box<dyn CustomizeConnection<M::Connection, M::Error>>,
225 | |     ) -> Builder<M> {
    | |___________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
help: add the attribute
    |
222 ~     #[must_use] pub fn connection_customizer(
223 +         mut self,
224 +         connection_customizer: Box<dyn CustomizeConnection<M::Connection, M::Error>>,
225 ~     ) -> Builder<M> {
    |

warning: missing `#[must_use]` attribute on a method returning `Self`
   --> bb8/src/api.rs:222:5
    |
222 | /     pub fn connection_customizer(
223 | |         mut self,
224 | |         connection_customizer: Box<dyn CustomizeConnection<M::Connection, M::Error>>,
225 | |     ) -> Builder<M> {
226 | |         self.connection_customizer = Some(connection_customizer);
227 | |         self
228 | |     }
    | |_____^
    |
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use

warning: docs for function returning `Result` missing `# Errors` section
   --> bb8/src/api.rs:247:5
    |
247 | /     pub async fn build(self, manager: M) -> Result<Pool<M>, M::Error> {
248 | |         let pool = self.build_inner(manager);
249 | |         pool.inner.start_connections().await.map(|()| pool)
250 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: non-binding `let` on a type that implements `Drop`
   --> bb8/src/api.rs:315:9
    |
315 |         let _ = self.conn.take();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-W clippy::let-underscore-drop` implied by `-W clippy::pedantic`
    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

warning: consider adding a `;` to the last statement for consistent formatting
   --> bb8/src/api.rs:366:9
    |
366 |         self.pool.as_ref().put_back(self.conn.take())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.pool.as_ref().put_back(self.conn.take());`
    |
    = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

warning: consider adding a `;` to the last statement for consistent formatting
  --> bb8/src/inner.rs:46:13
   |
46 |             result?
   |             ^^^^^^^ help: add a `;` here: `result?;`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

warning: unnecessary boolean `not` operation
   --> bb8/src/inner.rs:157:13
    |
157 | /             if !self.inner.manager.has_broken(&mut conn.conn) {
158 | |                 Some(conn)
159 | |             } else {
160 | |                 None
161 | |             }
    | |_____________^
    |
    = note: `-W clippy::if-not-else` implied by `-W clippy::pedantic`
    = help: remove the `!` and swap the blocks of the `if`/`else`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> bb8/src/inner.rs:165:9
    |
165 | /         match conn {
166 | |             Some(conn) => locked.put(conn, None, self.inner.clone()),
167 | |             None => {
168 | |                 let approvals = locked.dropped(1, &self.inner.statics);
169 | |                 self.spawn_replenishing_approvals(approvals);
170 | |             }
171 | |         }
    | |_________^
    |
    = note: `-W clippy::single-match-else` implied by `-W clippy::pedantic`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
help: try this
    |
165 ~         if let Some(conn) = conn { locked.put(conn, None, self.inner.clone()) } else {
166 +             let approvals = locked.dropped(1, &self.inner.statics);
167 +             self.spawn_replenishing_approvals(approvals);
168 +         }
    |

warning: consider adding a `;` to the last statement for consistent formatting
   --> bb8/src/inner.rs:265:17
    |
265 |                 PoolInner { inner }.reap()
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `PoolInner { inner }.reap();`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

warning: this argument is passed by value, but not consumed in the function body
  --> bb8/src/internals.rs:63:19
   |
63 |         approval: Option<Approval>,
   |                   ^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Approval>`
   |
   = note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value

warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
  --> bb8/src/internals.rs:97:25
   |
97 |         let available = self.conns.len() as u32 + self.pending_conns;
   |                         ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation

warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
   --> bb8/src/internals.rs:145:22
    |
145 |         self.dropped((before - self.conns.len()) as u32, config)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation

warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
   --> bb8/src/internals.rs:151:31
    |
151 |             idle_connections: self.conns.len() as u32,
    |                               ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation

warning: you seem to be trying to use `match` for an equality check. Consider using `if`
   --> bb8/src/internals.rs:206:9
    |
206 | /         match self.num {
207 | |             0 => None,
208 | |             _ => {
209 | |                 self.num -= 1;
210 | |                 Some(Approval { _priv: () })
211 | |             }
212 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
help: try this
    |
206 ~         if self.num == 0 { None } else {
207 +             self.num -= 1;
208 +             Some(Approval { _priv: () })
209 +         }
    |

warning: `bb8` (lib) generated 42 warnings
warning: docs for function returning `Result` missing `# Errors` section
  --> postgres/src/lib.rs:35:5
   |
35 | /     pub fn new_from_stringlike<T>(
36 | |         params: T,
37 | |         tls: Tls,
38 | |     ) -> Result<PostgresConnectionManager<Tls>, Error>
...  |
44 | |         Ok(Self::new(config, tls))
45 | |     }
   | |_____^
   |
   = note: `-W clippy::missing-errors-doc` implied by `-W clippy::pedantic`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: this argument is passed by value, but not consumed in the function body
  --> postgres/src/lib.rs:36:17
   |
36 |         params: T,
   |                 ^ help: consider taking a reference instead: `&T`
   |
   = note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value

warning: this trait bound is already specified in the where clause
  --> postgres/src/lib.rs:52:46
   |
52 |     <Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
   |                                              ^^^^
   |
   = note: `-W clippy::trait-duplication-in-bounds` implied by `-W clippy::pedantic`
   = help: consider removing this trait bound
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trait_duplication_in_bounds

warning: docs for function returning `Result` missing `# Errors` section
  --> redis/src/lib.rs:54:5
   |
54 | /     pub fn new<T: IntoConnectionInfo>(info: T) -> Result<RedisConnectionManager, RedisError> {
55 | |         Ok(RedisConnectionManager {
56 | |             client: Client::open(info.into_connection_info()?)?,
57 | |         })
58 | |     }
   | |_____^
   |
   = note: `-W clippy::missing-errors-doc` implied by `-W clippy::pedantic`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: `bb8-postgres` (lib) generated 3 warnings
warning: `bb8-redis` (lib) generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
@djc
Copy link
Owner

djc commented Jul 30, 2022

Let's start with a PR that fixes these: return_self_not_must_use, missing_panic_docs, trait-duplication-in-bounds, semicolon-if-nothing-returned, default-trait-access, then we can go from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants