You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inline variables in a format string and eliminate these warnings.
cargo clippy
Checking curp v0.1.0 (/home/jiawei/Xline/curp)
error: variables can be used directly in the `format!` string
--> curp/src/client.rs:252:58
|
252 |return Err(ProposeError::SyncedError(format!("{:?}", e)));| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
note: the lint level is defined here
--> curp/src/lib.rs:44:5
|
44 | clippy::pedantic,
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::uninlined_format_args)]` implied by `#[deny(clippy::pedantic)]`
help: change this to
|
252 - return Err(ProposeError::SyncedError(format!("{:?}", e)));
252 + return Err(ProposeError::SyncedError(format!("{e:?}")));|
error: variables can be used directly in the `format!` string
--> curp/src/server/mod.rs:167:17
|
167 | format!("0.0.0.0:{}", port)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
167 - format!("0.0.0.0:{}", port)
167 + format!("0.0.0.0:{port}")
|
error: variables can be used directly in the `format!` string
--> curp/src/server/mod.rs:169:60
|
169 | .map_err(|e| ServerError::ParsingError(format!("{}", e)))?,
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
169 - .map_err(|e| ServerError::ParsingError(format!("{}", e)))?,
169 + .map_err(|e| ServerError::ParsingError(format!("{e}")))?,
|
error: variables can be used directly in the `format!` string
--> curp/src/server/mod.rs:403:45
|
403 | tonic::Status::invalid_argument(format!("propose cmd decode failed: {}", e))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
403 - tonic::Status::invalid_argument(format!("propose cmd decode failed: {}", e))
403 + tonic::Status::invalid_argument(format!("propose cmd decode failed: {e}"))
|
error: variables can be used directly in the `format!` string
--> curp/src/server/mod.rs:483:45
|
483 | tonic::Status::invalid_argument(format!("wait_synced id decode failed: {}", e))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
483 - tonic::Status::invalid_argument(format!("wait_synced id decode failed: {}", e))
483 + tonic::Status::invalid_argument(format!("wait_synced id decode failed: {e}"))
|
error: variables can be used directly in the `format!` string
--> curp/src/server/mod.rs:584:50
|
584 | .map_err(|e| tonic::Status::internal(format!("encode or decode error, {}", e)))?;| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
584 - .map_err(|e| tonic::Status::internal(format!("encode or decode error, {}", e)))?;
584 + .map_err(|e| tonic::Status::internal(format!("encode or decode error, {e}")))?;|
error: could not compile `curp` due to 6 previous errors
The text was updated successfully, but these errors were encountered:
Inline variables in a format string and eliminate these warnings.
The text was updated successfully, but these errors were encountered: