Commit ea9e448 1 parent 4cd7f86 commit ea9e448 Copy full SHA for ea9e448
File tree 9 files changed +11
-12
lines changed
9 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,7 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
192
192
name : elems[ 0 ] . try_into ( ) ?,
193
193
version : elems
194
194
. 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) )
197
196
. expect ( "Could not parse virtual package version" ) ,
198
197
build_string : ( * elems. get ( 2 ) . unwrap_or ( & "" ) ) . to_string ( ) ,
199
198
} )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ pub enum Platform {
37
37
38
38
impl PartialOrd for Platform {
39
39
fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
40
- self . as_str ( ) . partial_cmp ( other. as_str ( ) )
40
+ Some ( self . cmp ( other) )
41
41
}
42
42
}
43
43
@@ -270,7 +270,7 @@ impl FromStr for Platform {
270
270
string => {
271
271
return Err ( ParsePlatformError {
272
272
string : string. to_owned ( ) ,
273
- } )
273
+ } ) ;
274
274
}
275
275
} )
276
276
}
@@ -390,7 +390,7 @@ impl FromStr for Arch {
390
390
string => {
391
391
return Err ( ParseArchError {
392
392
string : string. to_owned ( ) ,
393
- } )
393
+ } ) ;
394
394
}
395
395
} )
396
396
}
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ impl RepoData {
197
197
}
198
198
}
199
199
200
- self . removed . extend ( removed. into_iter ( ) ) ;
200
+ self . removed . extend ( removed) ;
201
201
}
202
202
}
203
203
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ impl QueueRef<'_> {
70
70
///
71
71
/// Safety: the queue must not have been freed
72
72
pub ( super ) unsafe fn from_ffi_queue < T > ( _source : & T , queue : ffi:: Queue ) -> QueueRef < ' _ > {
73
- QueueRef ( queue, PhantomData :: default ( ) )
73
+ QueueRef ( queue, PhantomData )
74
74
}
75
75
76
76
/// Returns an iterator over the ids of the queue
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl<'pool> Repo<'pool> {
34
34
unsafe {
35
35
let repo_ptr = ffi:: repo_create ( pool. raw_ptr ( ) , c_url. as_ptr ( ) ) ;
36
36
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 )
38
38
}
39
39
}
40
40
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ impl Repodata<'_> {
16
16
) -> Repodata < ' a > {
17
17
Repodata (
18
18
NonNull :: new ( ptr) . expect ( "repodata ptr was null" ) ,
19
- PhantomData :: default ( ) ,
19
+ PhantomData ,
20
20
)
21
21
}
22
22
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl<'pool> Solver<'pool> {
21
21
/// Constructs a new Solver from the provided libsolv pointer. It is the responsibility of the
22
22
/// caller to ensure the pointer is actually valid.
23
23
pub ( super ) unsafe fn new ( _pool : & Pool , ptr : NonNull < ffi:: Solver > ) -> Solver < ' _ > {
24
- Solver ( ptr, PhantomData :: default ( ) )
24
+ Solver ( ptr, PhantomData )
25
25
}
26
26
27
27
/// Returns a raw pointer to the wrapped `ffi::Solver`, to be used for calling ffi functions
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ impl Transaction<'_> {
25
25
_solver : & ' a Solver < ' a > ,
26
26
ptr : NonNull < ffi:: Transaction > ,
27
27
) -> Transaction < ' a > {
28
- Transaction ( ptr, PhantomData :: default ( ) )
28
+ Transaction ( ptr, PhantomData )
29
29
}
30
30
31
31
/// Returns a raw pointer to the wrapped `ffi::Transaction`, to be used for calling ffi functions
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl<'a> From<NamelessMatchSpec> for SolverMatchSpec<'a> {
56
56
fn from ( value : NamelessMatchSpec ) -> Self {
57
57
Self {
58
58
inner : value,
59
- _marker : PhantomData :: default ( ) ,
59
+ _marker : PhantomData ,
60
60
}
61
61
}
62
62
}
You can’t perform that action at this time.
0 commit comments