lints: A bunch of extra style lint fixes (#36568)
- **lints: Fix 'doc_lazy_continuation'** - **lints: Fix 'doc_overindented_list_items'** - **inherent_to_string and io_other_error** - **Some more lint fixes** - **lints: enable bool_assert_comparison, match_like_matches_macro and wrong_self_convention** Release Notes: - N/A
This commit is contained in:
parent
a32a264508
commit
cf7c64d77f
92 changed files with 277 additions and 345 deletions
|
@ -153,17 +153,11 @@ impl FileStatus {
|
|||
}
|
||||
|
||||
pub fn is_conflicted(self) -> bool {
|
||||
match self {
|
||||
FileStatus::Unmerged { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, FileStatus::Unmerged { .. })
|
||||
}
|
||||
|
||||
pub fn is_ignored(self) -> bool {
|
||||
match self {
|
||||
FileStatus::Ignored => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, FileStatus::Ignored)
|
||||
}
|
||||
|
||||
pub fn has_changes(&self) -> bool {
|
||||
|
@ -176,40 +170,31 @@ impl FileStatus {
|
|||
|
||||
pub fn is_modified(self) -> bool {
|
||||
match self {
|
||||
FileStatus::Tracked(tracked) => match (tracked.index_status, tracked.worktree_status) {
|
||||
(StatusCode::Modified, _) | (_, StatusCode::Modified) => true,
|
||||
_ => false,
|
||||
},
|
||||
FileStatus::Tracked(tracked) => matches!(
|
||||
(tracked.index_status, tracked.worktree_status),
|
||||
(StatusCode::Modified, _) | (_, StatusCode::Modified)
|
||||
),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_created(self) -> bool {
|
||||
match self {
|
||||
FileStatus::Tracked(tracked) => match (tracked.index_status, tracked.worktree_status) {
|
||||
(StatusCode::Added, _) | (_, StatusCode::Added) => true,
|
||||
_ => false,
|
||||
},
|
||||
FileStatus::Tracked(tracked) => matches!(
|
||||
(tracked.index_status, tracked.worktree_status),
|
||||
(StatusCode::Added, _) | (_, StatusCode::Added)
|
||||
),
|
||||
FileStatus::Untracked => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_deleted(self) -> bool {
|
||||
match self {
|
||||
FileStatus::Tracked(tracked) => match (tracked.index_status, tracked.worktree_status) {
|
||||
(StatusCode::Deleted, _) | (_, StatusCode::Deleted) => true,
|
||||
_ => false,
|
||||
},
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, FileStatus::Tracked(tracked) if matches!((tracked.index_status, tracked.worktree_status), (StatusCode::Deleted, _) | (_, StatusCode::Deleted)))
|
||||
}
|
||||
|
||||
pub fn is_untracked(self) -> bool {
|
||||
match self {
|
||||
FileStatus::Untracked => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, FileStatus::Untracked)
|
||||
}
|
||||
|
||||
pub fn summary(self) -> GitSummary {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue