rust/clippy: Lints for Defensive Programming
Fixes for rust/clippy: Lints for Defensive Programming - 9584e6f. Added all suggested Clippy lints :).
25 files changed
+113
-52
02318f19
→
d860ec15
modified Cargo.toml
@@ -81,6 +81,12 @@ radicle-surf = "0.26.0"
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/cob.rs
@@ -150,7 +150,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -167,7 +167,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/cob/args.rs
@@ -210,6 +210,7 @@ where
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/follow.rs
@@ -14,12 +14,8 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/id/args.rs
@@ -55,6 +55,7 @@ pub(super) fn parse_many_upserts(
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/inbox.rs
@@ -453,7 +453,8 @@ fn show(
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/issue/args.rs
@@ -196,7 +196,7 @@ impl Command {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/patch/args.rs
@@ -415,7 +415,7 @@ impl From<CommentArgs> for CommentAction {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/commands/patch/review/builder.rs
@@ -186,7 +186,10 @@ impl ReviewItem {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -277,7 +280,7 @@ impl ReviewItem {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/git.rs
@@ -43,6 +43,7 @@ pub struct Rev(String);
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -344,14 +345,6 @@ pub fn check_version() -> Result<Version, anyhow::Error> {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
|
|
|
|
|
modified crates/radicle-cli/src/git/ddiff.rs
@@ -382,6 +382,7 @@ impl DDiff {
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/git/pretty_diff.rs
@@ -537,14 +537,14 @@ impl ToPretty for Modification {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -554,7 +554,7 @@ impl ToPretty for Modification {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/git/unified_diff.rs
@@ -33,11 +33,12 @@ impl Error {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -137,12 +138,14 @@ impl TryFrom<&Hunk<Modification>> for HunkHeader {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -579,6 +582,7 @@ impl<'a> Writer<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/node.rs
@@ -25,12 +25,14 @@ pub struct SyncSettings {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -44,6 +46,7 @@ impl SyncSettings {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -87,7 +90,7 @@ impl SyncError {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/terminal/cob.rs
@@ -51,6 +51,7 @@ pub mod migrate {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -102,6 +103,9 @@ where
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/terminal/format.rs
@@ -17,6 +17,7 @@ use radicle_term::element::Line;
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -26,10 +27,12 @@ pub fn node_id_human_compact(node: &NodeId) -> Paint<String> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -72,17 +75,20 @@ pub fn command<D: fmt::Display>(cmd: D) -> Paint<String> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -91,6 +97,7 @@ pub fn visibility(v: &Visibility) -> Paint<&str> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -108,6 +115,7 @@ pub fn timestamp(time: impl Into<LocalTime>) -> Paint<String> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -125,6 +133,7 @@ pub fn bytes(size: usize) -> Paint<String> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -134,6 +143,7 @@ pub fn ref_update(update: &RefUpdate) -> Paint<&'static str> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -175,6 +185,7 @@ pub struct Identity<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -183,11 +194,13 @@ impl<'a> Identity<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -227,6 +240,7 @@ pub struct Author<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -238,10 +252,12 @@ impl<'a> Author<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -256,6 +272,7 @@ impl<'a> Author<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -274,6 +291,7 @@ impl<'a> Author<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -283,6 +301,7 @@ impl<'a> Author<'a> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -290,6 +309,7 @@ pub mod html {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -323,6 +343,7 @@ pub mod issue {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -341,6 +362,7 @@ pub mod patch {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -350,6 +372,7 @@ pub mod patch {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -366,6 +389,7 @@ pub mod identity {
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/terminal/highlight.rs
@@ -59,6 +59,7 @@ impl Default for Theme {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -68,6 +69,7 @@ impl Theme {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -145,9 +147,11 @@ impl Builder {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/terminal/io.rs
@@ -21,6 +21,7 @@ pub struct PassphraseValidator {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -78,7 +79,7 @@ pub fn comment_select(issue: &Issue) -> anyhow::Result<(&CommentId, &Comment)> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/terminal/patch.rs
@@ -140,6 +140,7 @@ blank is also okay.
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-cli/src/terminal/upload_pack.rs
@@ -22,6 +22,7 @@ impl Default for UploadPack {
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-cli/tests/commands.rs
@@ -338,7 +338,7 @@ fn rad_config() {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-core/src/repo.rs
@@ -47,6 +47,7 @@ impl RepoId {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -65,6 +66,7 @@ impl RepoId {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -234,10 +236,12 @@ mod sqlite_impls {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-localtime/src/lib.rs
@@ -30,19 +30,26 @@ impl LocalTime {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -50,16 +57,19 @@ impl LocalTime {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -69,6 +79,7 @@ impl LocalTime {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -78,6 +89,7 @@ impl LocalTime {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -94,15 +106,6 @@ impl LocalTime {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
|
|
|
|
|
@@ -151,31 +154,37 @@ impl LocalDuration {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-node/src/main.rs
@@ -51,6 +51,9 @@ enum Logger {
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/wire.rs
@@ -5,7 +5,7 @@ use std::collections::hash_map::Entry;
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -13,6 +13,7 @@ use cyphernet::addr::{HostName, InetHost, NetAddr};
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -510,7 +511,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|