Skip to content

Commit 00587b1

Browse files
ref: Fix new clippy lints
1 parent 739bc00 commit 00587b1

5 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/commands/debug_files/bundle_sources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn make_command(command: Command) -> Command {
3232
}
3333

3434
fn is_dsym(path: &Path) -> bool {
35-
path.extension().map_or(false, |e| e == "dSYM")
35+
path.extension().is_some_and(|e| e == "dSYM")
3636
}
3737

3838
fn get_sane_parent(path: &Path) -> &Path {

src/utils/dif_upload/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,7 @@ fn find_uuid_plists(
591591
// └─ DWARF
592592
// └─ App
593593
let plist_name = format!("{:X}.plist", uuid.as_hyphenated());
594-
let plist = match source.get_relative(format!("../{}", &plist_name)) {
595-
Some(plist) => plist,
596-
None => return None,
597-
};
594+
let plist = source.get_relative(format!("../{}", &plist_name))?;
598595

599596
let mut plists = BTreeMap::new();
600597
plists.insert(plist_name, plist);
@@ -1697,7 +1694,7 @@ impl<'a> DifUpload<'a> {
16971694

16981695
/// Determines if this file extension matches the search criteria.
16991696
fn valid_extension(&self, ext: Option<&OsStr>) -> bool {
1700-
self.extensions.is_empty() || ext.map_or(false, |e| self.extensions.contains(e))
1697+
self.extensions.is_empty() || ext.is_some_and(|e| self.extensions.contains(e))
17011698
}
17021699

17031700
/// Determines if this [`DifFormat`] matches the search criteria.

src/utils/file_search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl ReleaseFileSearch {
136136

137137
for result in builder.build() {
138138
let file = result?;
139-
if file.file_type().map_or(false, |t| t.is_dir()) {
139+
if file.file_type().is_some_and(|t| t.is_dir()) {
140140
continue;
141141
}
142142
pb.set_message(&format!("{}", file.path().display()));

src/utils/file_upload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn initialize_legacy_release_upload(context: &UploadContext) -> Result<()> {
4242
// if a project is provided which is technically unnecessary for the
4343
// legacy upload though it will unlikely to be what users want.
4444
if context.project.is_some()
45-
&& context.chunk_upload_options.map_or(false, |x| {
45+
&& context.chunk_upload_options.is_some_and(|x| {
4646
x.supports(ChunkUploadCapability::ArtifactBundles)
4747
|| x.supports(ChunkUploadCapability::ArtifactBundlesV2)
4848
})

src/utils/sourcemaps/inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub fn find_matching_paths(candidate_paths: &[String], expected_path: &str) -> V
284284
while candidate_segments
285285
.peek()
286286
.zip(expected_segments.peek())
287-
.map_or(false, |(x, y)| x == y)
287+
.is_some_and(|(x, y)| x == y)
288288
{
289289
candidate_segments.next();
290290
expected_segments.next();

0 commit comments

Comments
 (0)