Skip to content

Commit ef112b9

Browse files
committed
Warn about as usage in time related code
See bug #771
1 parent abb13ca commit ef112b9

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

serde_with/src/chrono_0_4.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
//!
55
//! [chrono]: https://docs.rs/chrono/
66
7+
// Serialization of large numbers can result in overflows
8+
// The time calculations are prone to this, so lint here extra
9+
// https://github.com/jonasbb/serde_with/issues/771
10+
#![warn(clippy::as_conversions)]
11+
712
use crate::{
813
formats::{Flexible, Format, Strict, Strictness},
914
prelude::*,

serde_with/src/time_0_3.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
//!
88
//! [time]: https://docs.rs/time/0.3/
99
10+
// Serialization of large numbers can result in overflows
11+
// The time calculations are prone to this, so lint here extra
12+
// https://github.com/jonasbb/serde_with/issues/771
13+
#![warn(clippy::as_conversions)]
14+
1015
use crate::{
1116
formats::{Flexible, Format, Strict, Strictness},
1217
prelude::*,

serde_with/src/utils/duration.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
//! Internal Helper types
22
3+
// Serialization of large numbers can result in overflows
4+
// The time calculations are prone to this, so lint here extra
5+
// https://github.com/jonasbb/serde_with/issues/771
6+
#![warn(clippy::as_conversions)]
7+
38
use crate::{
49
formats::{Flexible, Format, Strict, Strictness},
510
prelude::*,

0 commit comments

Comments
 (0)