mirror of
				https://github.com/serde-rs/serde.git
				synced 2025-11-03 23:13:52 +00:00 
			
		
		
		
	Touch up PR 1997
This commit is contained in:
		
							parent
							
								
									d91075c8d5
								
							
						
					
					
						commit
						697b082e90
					
				@ -76,7 +76,7 @@ fn main() {
 | 
				
			|||||||
        println!("cargo:rustc-cfg=serde_derive");
 | 
					        println!("cargo:rustc-cfg=serde_derive");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TryFrom, Atomic types, non-zero signed integers, and `SystemTime::checked_add`
 | 
					    // TryFrom, Atomic types, non-zero signed integers, and SystemTime::checked_add
 | 
				
			||||||
    // stabilized in Rust 1.34:
 | 
					    // stabilized in Rust 1.34:
 | 
				
			||||||
    // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#tryfrom-and-tryinto
 | 
					    // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#tryfrom-and-tryinto
 | 
				
			||||||
    // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#library-stabilizations
 | 
					    // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#library-stabilizations
 | 
				
			||||||
 | 
				
			|||||||
@ -2130,7 +2130,7 @@ impl<'de> Deserialize<'de> for SystemTime {
 | 
				
			|||||||
        #[cfg(systemtime_checked_add)]
 | 
					        #[cfg(systemtime_checked_add)]
 | 
				
			||||||
        let ret = UNIX_EPOCH
 | 
					        let ret = UNIX_EPOCH
 | 
				
			||||||
            .checked_add(duration)
 | 
					            .checked_add(duration)
 | 
				
			||||||
            .ok_or(D::Error::custom("overflow deserializing SystemTime"));
 | 
					            .ok_or_else(|| D::Error::custom("overflow deserializing SystemTime"));
 | 
				
			||||||
        #[cfg(not(systemtime_checked_add))]
 | 
					        #[cfg(not(systemtime_checked_add))]
 | 
				
			||||||
        let ret = Ok(UNIX_EPOCH + duration);
 | 
					        let ret = Ok(UNIX_EPOCH + duration);
 | 
				
			||||||
        ret
 | 
					        ret
 | 
				
			||||||
 | 
				
			|||||||
@ -192,15 +192,6 @@ macro_rules! declare_tests {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
macro_rules! declare_error_tests {
 | 
					macro_rules! declare_error_tests {
 | 
				
			||||||
    ($($name:ident<$target:ty> { $tokens:expr, $expected:expr, })+) => {
 | 
					 | 
				
			||||||
        $(
 | 
					 | 
				
			||||||
            #[test]
 | 
					 | 
				
			||||||
            fn $name() {
 | 
					 | 
				
			||||||
                assert_de_tokens_error::<$target>($tokens, $expected);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        )+
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ($(
 | 
					    ($(
 | 
				
			||||||
        $(#[$cfg:meta])*
 | 
					        $(#[$cfg:meta])*
 | 
				
			||||||
        $name:ident<$target:ty> { $tokens:expr, $expected:expr, }
 | 
					        $name:ident<$target:ty> { $tokens:expr, $expected:expr, }
 | 
				
			||||||
 | 
				
			|||||||
@ -1903,7 +1903,10 @@ fn test_internally_tagged_newtype_variant_containing_unit_struct() {
 | 
				
			|||||||
    assert_de_tokens(
 | 
					    assert_de_tokens(
 | 
				
			||||||
        &Message::Info(Info),
 | 
					        &Message::Info(Info),
 | 
				
			||||||
        &[
 | 
					        &[
 | 
				
			||||||
            Token::Struct { name: "Message", len: 1 },
 | 
					            Token::Struct {
 | 
				
			||||||
 | 
					                name: "Message",
 | 
				
			||||||
 | 
					                len: 1,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
            Token::Str("topic"),
 | 
					            Token::Str("topic"),
 | 
				
			||||||
            Token::Str("Info"),
 | 
					            Token::Str("Info"),
 | 
				
			||||||
            Token::StructEnd,
 | 
					            Token::StructEnd,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user