Skip to content

Commit 9193b05

Browse files
committed
thanks clippy
1 parent 8d84818 commit 9193b05

File tree

21 files changed

+33
-33
lines changed

21 files changed

+33
-33
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,4 @@ stable_sort_primitive = "allow" # x1
394394
no_effect_underscore_binding = "allow" # x1
395395
empty_docs = "allow"
396396
too_long_first_doc_paragraph = "allow"
397+
large_stack_arrays = "allow"

gitoxide-core/src/repository/attributes/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub(crate) mod function {
8989
let entry = cache.at_entry(
9090
path,
9191
Some(is_dir_to_mode(
92-
workdir.map_or(false, |wd| wd.join(gix::path::from_bstr(path)).is_dir())
92+
workdir.is_some_and(|wd| wd.join(gix::path::from_bstr(path)).is_dir())
9393
|| pattern.signature.contains(gix::pathspec::MagicSignature::MUST_BE_DIR),
9494
)),
9595
)?;

gitoxide-core/src/repository/clean.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ pub(crate) mod function {
128128
let pathspec_includes_entry = match pathspec.as_mut() {
129129
None => entry
130130
.pathspec_match
131-
.map_or(false, |m| m != gix::dir::entry::PathspecMatch::Excluded),
131+
.is_some_and(|m| m != gix::dir::entry::PathspecMatch::Excluded),
132132
Some(pathspec) => pathspec
133133
.pattern_matching_relative_path(entry.rela_path.as_bstr(), entry.disk_kind.map(|k| k.is_dir()))
134-
.map_or(false, |m| !m.is_excluded()),
134+
.is_some_and(|m| !m.is_excluded()),
135135
};
136136
pruned_entries += usize::from(!pathspec_includes_entry);
137137
if !pathspec_includes_entry && debug {

gitoxide-core/src/repository/config.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn list(
3232
}
3333

3434
let meta = section.meta();
35-
if last_meta.map_or(true, |last| last != meta) {
35+
if last_meta != Some(meta) {
3636
write_meta(meta, &mut out)?;
3737
}
3838
last_meta = Some(meta);
@@ -41,9 +41,10 @@ pub fn list(
4141
for event in matter {
4242
event.write_to(&mut out)?;
4343
}
44-
if it.peek().map_or(false, |(next_section, _)| {
45-
next_section.header().name() != section.header().name()
46-
}) {
44+
if it
45+
.peek()
46+
.is_some_and(|(next_section, _)| next_section.header().name() != section.header().name())
47+
{
4748
writeln!(&mut out)?;
4849
}
4950
}

gitoxide-core/src/repository/exclude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub fn query(
9393
let entry = cache.at_entry(
9494
path,
9595
Some(is_dir_to_mode(
96-
workdir.map_or(false, |wd| wd.join(gix::path::from_bstr(path)).is_dir())
96+
workdir.is_some_and(|wd| wd.join(gix::path::from_bstr(path)).is_dir())
9797
|| pattern.signature.contains(gix::pathspec::MagicSignature::MUST_BE_DIR),
9898
)),
9999
)?;

gitoxide-core/src/repository/fetch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub(crate) mod function {
305305
for fix in &map.fixes {
306306
match fix {
307307
Fix::MappingWithPartialDestinationRemoved { name, spec } => {
308-
if prev_spec.map_or(true, |prev_spec| prev_spec != spec) {
308+
if prev_spec.is_some_and(|prev_spec| prev_spec != spec) {
309309
prev_spec = spec.into();
310310
spec.to_ref().write_to(&mut err)?;
311311
writeln!(err)?;

gitoxide-core/src/repository/index/entries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub(crate) mod function {
198198
sms_by_path
199199
.iter()
200200
.find_map(|(path, sm)| (path == entry_path).then_some(sm))
201-
.filter(|sm| sm.git_dir_try_old_form().map_or(false, |dot_git| dot_git.exists()))
201+
.filter(|sm| sm.git_dir_try_old_form().is_ok_and(|dot_git| dot_git.exists()))
202202
})
203203
{
204204
let sm_path = gix::path::to_unix_separators_on_windows(sm.path()?);

gitoxide-core/src/repository/remote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ mod refs_impl {
190190
for fix in &map.fixes {
191191
match fix {
192192
Fix::MappingWithPartialDestinationRemoved { name, spec } => {
193-
if prev_spec.map_or(true, |prev_spec| prev_spec != spec) {
193+
if prev_spec.is_some_and(|prev_spec| prev_spec != spec) {
194194
prev_spec = spec.into();
195195
spec.to_ref().write_to(&mut err)?;
196196
writeln!(err)?;

gitoxide-core/src/repository/revision/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub(crate) mod function {
108108
}
109109
}
110110
progress.inc();
111-
if limit.map_or(false, |limit| limit == progress.step()) {
111+
if limit.is_some_and(|limit| limit == progress.step()) {
112112
break;
113113
}
114114
}

gix-dir/src/walk/classify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub fn path(
215215

216216
let is_dir = if symlinks_to_directories_are_ignored_like_directories
217217
&& ctx.excludes.is_some()
218-
&& kind.map_or(false, |ft| ft == entry::Kind::Symlink)
218+
&& kind == Some(entry::Kind::Symlink)
219219
{
220220
path.metadata().ok().map(|md| is_dir_to_mode(md.is_dir()))
221221
} else {

0 commit comments

Comments
 (0)