clippy fixes

This commit is contained in:
nora 2022-12-19 11:08:56 +01:00
parent 0e1dba694d
commit 0568135f3d
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View file

@ -111,7 +111,7 @@ mod tests {
#[test] #[test]
fn number() { fn number() {
let result = format!("a: {}", 32523532u64); let result = format!("a: {}", 32_523_532_u64);
assert_eq!(result, "a: 32523532"); assert_eq!(result, "a: 32523532");
} }

View file

@ -45,7 +45,7 @@ fn dont_move() {
#[test] #[test]
fn ptr_correct_addr() { fn ptr_correct_addr() {
static STATIC: u8 = 0; static STATIC: u8 = 0;
let addr = std::format!("{:p}", (&STATIC) as *const u8); let addr = std::format!("{:p}", std::ptr::addr_of!(STATIC));
let fmt = format!("{:p}", &STATIC); let fmt = format!("{:p}", &STATIC);
assert_eq!(addr, fmt); assert_eq!(addr, fmt);

View file

@ -99,10 +99,10 @@ fn test_format_int() {
assert_eq!(format!("{:X}", 55), "37"); assert_eq!(format!("{:X}", 55), "37");
assert_eq!(format!("{:e}", 55), "5.5e1"); assert_eq!(format!("{:e}", 55), "5.5e1");
assert_eq!(format!("{:E}", 55), "5.5E1"); assert_eq!(format!("{:E}", 55), "5.5E1");
assert_eq!(format!("{:e}", 10000000000u64), "1e10"); assert_eq!(format!("{:e}", 10_000_000_000_u64), "1e10");
assert_eq!(format!("{:E}", 10000000000u64), "1E10"); assert_eq!(format!("{:E}", 10_000_000_000_u64), "1E10");
assert_eq!(format!("{:e}", 10000000001u64), "1.0000000001e10"); assert_eq!(format!("{:e}", 10_000_000_001_u64), "1.0000000001e10");
assert_eq!(format!("{:E}", 10000000001u64), "1.0000000001E10"); assert_eq!(format!("{:E}", 10_000_000_001_u64), "1.0000000001E10");
} }
#[test] #[test]