Skip to content

Commit 9241bd7

Browse files
committed
fix: remove float support, will be handled by pydantic for deprecation
1 parent abe32e6 commit 9241bd7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/serializers/config.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ serialization_mode! {
8888
TimedeltaMode,
8989
"ser_json_timedelta",
9090
Iso8601 => "iso8601",
91-
Float => "float",
9291
SecondsFloat => "seconds_float",
9392
MillisecondsFloat => "milliseconds_float"
9493
}
@@ -116,7 +115,7 @@ impl TimedeltaMode {
116115
let d = either_delta.to_duration()?;
117116
Ok(d.to_string().into_py(py))
118117
}
119-
Self::Float | Self::SecondsFloat => {
118+
Self::SecondsFloat => {
120119
// convert to int via a py timedelta not duration since we know this this case the input would have
121120
// been a py timedelta
122121
let seconds: f64 = either_delta.total_seconds()?;
@@ -138,7 +137,7 @@ impl TimedeltaMode {
138137
let d = either_delta.to_duration()?;
139138
Ok(d.to_string().into())
140139
}
141-
Self::Float | Self::SecondsFloat => {
140+
Self::SecondsFloat => {
142141
let seconds: f64 = either_delta.total_seconds()?;
143142
Ok(seconds.to_string().into())
144143
}
@@ -160,7 +159,7 @@ impl TimedeltaMode {
160159
let d = either_delta.to_duration().map_err(py_err_se_err)?;
161160
serializer.serialize_str(&d.to_string())
162161
}
163-
Self::Float | Self::SecondsFloat => {
162+
Self::SecondsFloat => {
164163
let seconds: f64 = either_delta.total_seconds().map_err(py_err_se_err)?;
165164
serializer.serialize_f64(seconds)
166165
}

0 commit comments

Comments
 (0)