Skip to content

Commit 547e4bd

Browse files
committed
chore: new clippy warnings dropped
I fix clippy warnings ^ | T_T | v they add new ones
1 parent a2ce200 commit 547e4bd

31 files changed

+96
-90
lines changed

tarantool/src/datetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl Display for Datetime {
122122
}
123123

124124
////////////////////////////////////////////////////////////////////////////////
125-
/// Tuple
125+
// Tuple
126126
////////////////////////////////////////////////////////////////////////////////
127127

128128
impl serde::Serialize for Datetime {
@@ -173,7 +173,7 @@ impl<'de> serde::Deserialize<'de> for Datetime {
173173
}
174174

175175
////////////////////////////////////////////////////////////////////////////////
176-
/// Lua
176+
// Lua
177177
////////////////////////////////////////////////////////////////////////////////
178178

179179
static CTID_DATETIME: Lazy<u32> = Lazy::new(|| {

tarantool/src/ffi/tarantool.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,15 @@ extern "C" {
3737
/// Wait until **READ** or **WRITE** event on socket (`fd`). Yields.
3838
/// - `fd` - non-blocking socket file description
3939
/// - `events` - requested events to wait.
40-
/// Combination of `TNT_IO_READ` | `TNT_IO_WRITE` bit flags.
40+
/// Combination of `TNT_IO_READ` | `TNT_IO_WRITE` bit flags.
4141
/// - `timeout` - timeout in seconds.
4242
///
4343
/// Returns:
4444
/// - `0` - timeout
45-
/// - `>0` - returned events. Combination of `TNT_IO_READ` | `TNT_IO_WRITE`
46-
/// bit flags.
45+
/// - `>0` - returned events. Combination of `TNT_IO_READ` | `TNT_IO_WRITE` bit flags.
4746
pub fn coio_wait(fd: c_int, event: c_int, timeout: f64) -> c_int;
4847

49-
/**
50-
* Close the fd and wake any fiber blocked in
51-
* coio_wait() call on this fd.
52-
*/
48+
/// Close the fd and wake any fiber blocked in coio_wait() call on this fd.
5349
pub fn coio_close(fd: c_int) -> c_int;
5450

5551
/// Fiber-friendly version of getaddrinfo(3).
@@ -63,8 +59,8 @@ extern "C" {
6359
/// Returns:
6460
/// - `0` on success, please free @a res using freeaddrinfo(3).
6561
/// - `-1` on error, check diag.
66-
/// Please note that the return value is not compatible with
67-
/// getaddrinfo(3).
62+
///
63+
/// > Please note that the return value is not compatible with getaddrinfo(3).
6864
pub fn coio_getaddrinfo(
6965
host: *const c_char,
7066
port: *const c_char,

tarantool/src/fiber.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! With the fiber module, you can:
44
//! - create, run and manage [fibers](Builder),
55
//! - use a synchronization mechanism for fibers, similar to “condition variables” and similar to operating-system
6-
//! functions such as `pthread_cond_wait()` plus `pthread_cond_signal()`,
6+
//! functions such as `pthread_cond_wait()` plus `pthread_cond_signal()`,
77
//! - spawn a fiber based [async runtime](async).
88
//!
99
//! See also:
@@ -110,14 +110,14 @@ pub struct Fiber<'a, T: 'a> {
110110
}
111111

112112
#[allow(deprecated)]
113-
impl<'a, T> ::std::fmt::Debug for Fiber<'a, T> {
113+
impl<T> ::std::fmt::Debug for Fiber<'_, T> {
114114
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
115115
f.debug_struct("Fiber").finish_non_exhaustive()
116116
}
117117
}
118118

119119
#[allow(deprecated)]
120-
impl<'a, T> Fiber<'a, T> {
120+
impl<T> Fiber<'_, T> {
121121
/// Create a new fiber.
122122
///
123123
/// Takes a fiber from fiber cache, if it's not empty. Can fail only if there is not enough memory for
@@ -1049,7 +1049,7 @@ pub struct JoinHandle<'f, T> {
10491049
marker: PhantomData<&'f ()>,
10501050
}
10511051

1052-
impl<'f, T> std::fmt::Debug for JoinHandle<'f, T> {
1052+
impl<T> std::fmt::Debug for JoinHandle<'_, T> {
10531053
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10541054
f.debug_struct("JoinHandle").finish_non_exhaustive()
10551055
}
@@ -1082,7 +1082,7 @@ enum JoinHandleImpl<T> {
10821082

10831083
type FiberResultCell<T> = Box<UnsafeCell<Option<T>>>;
10841084

1085-
impl<'f, T> JoinHandle<'f, T> {
1085+
impl<T> JoinHandle<'_, T> {
10861086
#[inline(always)]
10871087
fn ffi(fiber: NonNull<ffi::Fiber>, result_cell: Option<FiberResultCell<T>>) -> Self {
10881088
Self {
@@ -1253,7 +1253,7 @@ impl<'f, T> JoinHandle<'f, T> {
12531253
}
12541254
}
12551255

1256-
impl<'f, T> Drop for JoinHandle<'f, T> {
1256+
impl<T> Drop for JoinHandle<'_, T> {
12571257
fn drop(&mut self) {
12581258
if let Some(mut inner) = self.inner.take() {
12591259
if let JoinHandleImpl::Ffi { result_cell, .. } = &mut inner {

tarantool/src/fiber/async/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<T> From<T> for Mutex<T> {
191191
}
192192
}
193193

194-
impl<T: ?Sized + Default> Default for Mutex<T> {
194+
impl<T: Default> Default for Mutex<T> {
195195
/// Creates a `Mutex<T>`, with the `Default` value for T.
196196
fn default() -> Mutex<T> {
197197
Mutex::new(Default::default())

tarantool/src/fiber/async/watch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl<T> Drop for Sender<T> {
204204
/// to keep the borrow as short lived as possible.
205205
pub struct ValueRef<'a, T>(Ref<'a, Value<T>>);
206206

207-
impl<'a, T> Deref for ValueRef<'a, T> {
207+
impl<T> Deref for ValueRef<'_, T> {
208208
type Target = T;
209209

210210
fn deref(&self) -> &Self::Target {
@@ -312,7 +312,7 @@ impl<T> Clone for Receiver<T> {
312312
}
313313
}
314314

315-
impl<'a, T> Future for Notification<'a, T> {
315+
impl<T> Future for Notification<'_, T> {
316316
type Output = Result<(), RecvError>;
317317

318318
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

tarantool/src/fiber/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl<T> From<T> for Mutex<T> {
208208
}
209209
}
210210

211-
impl<T: ?Sized + Default> Default for Mutex<T> {
211+
impl<T: Default> Default for Mutex<T> {
212212
/// Creates a `Mutex<T>`, with the `Default` value for T.
213213
fn default() -> Mutex<T> {
214214
Mutex::new(Default::default())

tarantool/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#![allow(clippy::needless_late_init)]
99
#![allow(clippy::bool_assert_comparison)]
1010
#![allow(clippy::field_reassign_with_default)]
11+
#![allow(clippy::manual_unwrap_or)]
1112
#![allow(rustdoc::redundant_explicit_links)]
1213
//! Tarantool C API bindings for Rust.
1314
//! This library contains the following Tarantool API's:
@@ -229,7 +230,7 @@ pub mod vclock;
229230
/// [`Display`]), the return values read as follows:
230231
/// - `Ok(v)`: the stored procedure will return `v`
231232
/// - `Err(e)`: the stored procedure will fail and `e` will be set as the last
232-
/// Tarantool error (see also [`TarantoolError::last`])
233+
/// Tarantool error (see also [`TarantoolError::last`])
233234
/// ```no_run
234235
/// use tarantool::{error::Error, index::IteratorType::Eq, space::Space};
235236
///

tarantool/src/msgpack.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ mod test {
906906
}
907907

908908
#[cfg(feature = "internal_test")]
909+
#[allow(clippy::disallowed_names)]
909910
mod tests {
910911
use super::*;
911912
use pretty_assertions::assert_eq;

tarantool/src/msgpack/encode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ where
398398
}
399399
}
400400

401-
impl<'a, 'de, T> Decode<'de> for Cow<'a, T>
401+
impl<'de, T> Decode<'de> for Cow<'_, T>
402402
where
403-
T: Decode<'de> + ToOwned + ?Sized,
403+
T: Decode<'de> + ToOwned,
404404
{
405405
// Clippy doesn't notice the type difference
406406
#[allow(clippy::redundant_clone)]
@@ -746,7 +746,7 @@ where
746746
}
747747
}
748748

749-
impl<'a, T> Encode for Cow<'a, T>
749+
impl<T> Encode for Cow<'_, T>
750750
where
751751
T: Encode + ToOwned + ?Sized,
752752
{

tarantool/src/net_box/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
//! - The state machine starts in the `initial` state.
3232
//! - [Conn::new()](struct.Conn.html#method.new) method changes the state to `connecting` and spawns a worker fiber.
3333
//! - If authentication and schema upload are required, it’s possible later on to re-enter the `fetch_schema` state
34-
//! from `active` if a request fails due to a schema version mismatch error, so schema reload is triggered.
34+
//! from `active` if a request fails due to a schema version mismatch error, so schema reload is triggered.
3535
//! - [conn.close()](struct.Conn.html#method.close) method sets the state to `closed` and kills the worker. If the
36-
//! transport is already in the `error` state, [close()](struct.Conn.html#method.close) does nothing.
36+
//! transport is already in the `error` state, [close()](struct.Conn.html#method.close) does nothing.
3737
//!
3838
//! See also:
3939
//! - [Lua reference: Module net.box](https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/)

0 commit comments

Comments
 (0)