File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ fn unraw(ident: &proc_macro2::Ident) -> String {
99
99
100
100
// If `data` is a newtype, return the type it's wrapping.
101
101
fn newtype_inner ( data : & syn:: Data ) -> Option < syn:: Type > {
102
- match data {
103
- & Data :: Struct ( ref s) => {
102
+ match * data {
103
+ Data :: Struct ( ref s) => {
104
104
match s. fields {
105
105
Fields :: Unnamed ( ref fs) => {
106
106
if fs. unnamed . len ( ) == 1 {
@@ -452,6 +452,8 @@ pub fn to_primitive(input: TokenStream) -> TokenStream {
452
452
dummy_const_trick ( "ToPrimitive" , & name, impl_) . into ( )
453
453
}
454
454
455
+ #[ allow( renamed_and_removed_lints) ]
456
+ #[ cfg_attr( feature = "cargo-clippy" , allow( const_static_lifetime) ) ]
455
457
const NEWTYPE_ONLY : & ' static str = "This trait can only be derived for newtypes" ;
456
458
457
459
/// Derives [`num_traits::NumOps`][num_ops] for newtypes. The inner type must already implement
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ fn test_from_primitive() {
39
39
fn test_from_primitive_128 ( ) {
40
40
assert_eq ! (
41
41
MyFloat :: from_i128( std:: i128 :: MIN ) ,
42
- Some ( MyFloat ( -2.0 . powi( 127 ) ) )
42
+ Some ( MyFloat ( ( -2.0 ) . powi( 127 ) ) )
43
43
) ;
44
44
}
45
45
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ fn test_reflexive_for_trivial_case() {
58
58
. map ( |& x| -> Option < Color > { num_renamed:: FromPrimitive :: from_u64 ( x) } )
59
59
. map ( |x| x. and_then ( |x| num_renamed:: ToPrimitive :: to_u64 ( & x) ) )
60
60
. collect ( ) ;
61
- let before = before. into_iter ( ) . cloned ( ) . map ( Some ) . collect :: < Vec < _ > > ( ) ;
61
+ let before = before. iter ( ) . cloned ( ) . map ( Some ) . collect :: < Vec < _ > > ( ) ;
62
62
63
63
assert_eq ! ( before, after) ;
64
64
}
You can’t perform that action at this time.
0 commit comments