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 {
9999
100100// If `data` is a newtype, return the type it's wrapping.
101101fn newtype_inner ( data : & syn:: Data ) -> Option < syn:: Type > {
102- match data {
103- & Data :: Struct ( ref s) => {
102+ match * data {
103+ Data :: Struct ( ref s) => {
104104 match s. fields {
105105 Fields :: Unnamed ( ref fs) => {
106106 if fs. unnamed . len ( ) == 1 {
@@ -452,6 +452,8 @@ pub fn to_primitive(input: TokenStream) -> TokenStream {
452452 dummy_const_trick ( "ToPrimitive" , & name, impl_) . into ( )
453453}
454454
455+ #[ allow( renamed_and_removed_lints) ]
456+ #[ cfg_attr( feature = "cargo-clippy" , allow( const_static_lifetime) ) ]
455457const NEWTYPE_ONLY : & ' static str = "This trait can only be derived for newtypes" ;
456458
457459/// 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() {
3939fn test_from_primitive_128 ( ) {
4040 assert_eq ! (
4141 MyFloat :: from_i128( std:: i128 :: MIN ) ,
42- Some ( MyFloat ( -2.0 . powi( 127 ) ) )
42+ Some ( MyFloat ( ( -2.0 ) . powi( 127 ) ) )
4343 ) ;
4444}
4545
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ fn test_reflexive_for_trivial_case() {
5858 . map ( |& x| -> Option < Color > { num_renamed:: FromPrimitive :: from_u64 ( x) } )
5959 . map ( |x| x. and_then ( |x| num_renamed:: ToPrimitive :: to_u64 ( & x) ) )
6060 . collect ( ) ;
61- let before = before. into_iter ( ) . cloned ( ) . map ( Some ) . collect :: < Vec < _ > > ( ) ;
61+ let before = before. iter ( ) . cloned ( ) . map ( Some ) . collect :: < Vec < _ > > ( ) ;
6262
6363 assert_eq ! ( before, after) ;
6464}
You can’t perform that action at this time.
0 commit comments