ci: fix cargo clippy deprecated warnings (#412)

This commit is contained in:
gusto 2023-09-18 11:24:49 +03:00 committed by GitHub
parent 82946b8637
commit 8d9a1516be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 5 deletions

View File

@ -70,7 +70,9 @@ pub(super) async fn waku_send_transaction(
payload,
WAKU_CARNOT_TX_CONTENT_TOPIC.clone(),
1,
chrono::Utc::now().timestamp_nanos() as usize,
chrono::Utc::now()
.timestamp_nanos_opt()
.expect("timestamp should be in valid range") as usize,
[],
false,
),

View File

@ -131,7 +131,9 @@ impl NetworkAdapter for MockAdapter {
String::from_utf8_lossy(&message.as_bytes()).to_string(),
MOCK_APPROVAL_CONTENT_TOPIC,
1,
chrono::Utc::now().timestamp_nanos() as usize,
chrono::Utc::now()
.timestamp_nanos_opt()
.expect("timestamp should be in valid range") as usize,
);
if let Err((e, _e)) = self
.network_relay

View File

@ -134,7 +134,9 @@ impl WakuAdapter {
payload,
content_topic,
1,
chrono::Utc::now().timestamp_nanos() as usize,
chrono::Utc::now()
.timestamp_nanos_opt()
.expect("timestamp should be in valid range") as usize,
[],
false,
);

View File

@ -359,7 +359,10 @@ mod tests {
content_topic_name: "foo content".into(),
},
version: 1,
timestamp: chrono::Utc::now().timestamp_nanos() as usize,
timestamp: chrono::Utc::now()
.timestamp_nanos_opt()
.expect("timestamp should be in valid range")
as usize,
},
})
.await;
@ -376,7 +379,10 @@ mod tests {
content_topic_name: "bar content".into(),
},
version: 1,
timestamp: chrono::Utc::now().timestamp_nanos() as usize,
timestamp: chrono::Utc::now()
.timestamp_nanos_opt()
.expect("timestamp should be in valid range")
as usize,
},
})
.await;