Skip to content

Commit ea9e448

Browse files
committed
fix: clippy errors and warnings
1 parent 4cd7f86 commit ea9e448

File tree

9 files changed

+11
-12
lines changed

9 files changed

+11
-12
lines changed

crates/rattler-bin/src/commands/create.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
192192
name: elems[0].try_into()?,
193193
version: elems
194194
.get(1)
195-
.map(|s| Version::from_str(s))
196-
.unwrap_or(Version::from_str("0"))
195+
.map_or(Version::from_str("0"), |s| Version::from_str(s))
197196
.expect("Could not parse virtual package version"),
198197
build_string: (*elems.get(2).unwrap_or(&"")).to_string(),
199198
})

crates/rattler_conda_types/src/platform.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub enum Platform {
3737

3838
impl PartialOrd for Platform {
3939
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
40-
self.as_str().partial_cmp(other.as_str())
40+
Some(self.cmp(other))
4141
}
4242
}
4343

@@ -270,7 +270,7 @@ impl FromStr for Platform {
270270
string => {
271271
return Err(ParsePlatformError {
272272
string: string.to_owned(),
273-
})
273+
});
274274
}
275275
})
276276
}
@@ -390,7 +390,7 @@ impl FromStr for Arch {
390390
string => {
391391
return Err(ParseArchError {
392392
string: string.to_owned(),
393-
})
393+
});
394394
}
395395
})
396396
}

crates/rattler_conda_types/src/repo_data/patches.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl RepoData {
197197
}
198198
}
199199

200-
self.removed.extend(removed.into_iter());
200+
self.removed.extend(removed);
201201
}
202202
}
203203

crates/rattler_solve/src/libsolv_c/wrapper/queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl QueueRef<'_> {
7070
///
7171
/// Safety: the queue must not have been freed
7272
pub(super) unsafe fn from_ffi_queue<T>(_source: &T, queue: ffi::Queue) -> QueueRef<'_> {
73-
QueueRef(queue, PhantomData::default())
73+
QueueRef(queue, PhantomData)
7474
}
7575

7676
/// Returns an iterator over the ids of the queue

crates/rattler_solve/src/libsolv_c/wrapper/repo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<'pool> Repo<'pool> {
3434
unsafe {
3535
let repo_ptr = ffi::repo_create(pool.raw_ptr(), c_url.as_ptr());
3636
let non_null_ptr = NonNull::new(repo_ptr).expect("repo ptr was null");
37-
Repo(non_null_ptr, PhantomData::default())
37+
Repo(non_null_ptr, PhantomData)
3838
}
3939
}
4040

crates/rattler_solve/src/libsolv_c/wrapper/repodata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl Repodata<'_> {
1616
) -> Repodata<'a> {
1717
Repodata(
1818
NonNull::new(ptr).expect("repodata ptr was null"),
19-
PhantomData::default(),
19+
PhantomData,
2020
)
2121
}
2222

crates/rattler_solve/src/libsolv_c/wrapper/solver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<'pool> Solver<'pool> {
2121
/// Constructs a new Solver from the provided libsolv pointer. It is the responsibility of the
2222
/// caller to ensure the pointer is actually valid.
2323
pub(super) unsafe fn new(_pool: &Pool, ptr: NonNull<ffi::Solver>) -> Solver<'_> {
24-
Solver(ptr, PhantomData::default())
24+
Solver(ptr, PhantomData)
2525
}
2626

2727
/// Returns a raw pointer to the wrapped `ffi::Solver`, to be used for calling ffi functions

crates/rattler_solve/src/libsolv_c/wrapper/transaction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl Transaction<'_> {
2525
_solver: &'a Solver<'a>,
2626
ptr: NonNull<ffi::Transaction>,
2727
) -> Transaction<'a> {
28-
Transaction(ptr, PhantomData::default())
28+
Transaction(ptr, PhantomData)
2929
}
3030

3131
/// Returns a raw pointer to the wrapped `ffi::Transaction`, to be used for calling ffi functions

crates/rattler_solve/src/resolvo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'a> From<NamelessMatchSpec> for SolverMatchSpec<'a> {
5656
fn from(value: NamelessMatchSpec) -> Self {
5757
Self {
5858
inner: value,
59-
_marker: PhantomData::default(),
59+
_marker: PhantomData,
6060
}
6161
}
6262
}

0 commit comments

Comments
 (0)