Skip to content

Commit f1cb9ef

Browse files
Merge branch 'main' into raise_version_to_0.20.0-rc4
2 parents af55f86 + 70e294a commit f1cb9ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/structure/tfc/datatypes.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ pub struct Duration {
793793
pub day: u8,
794794
pub hour: u8,
795795
pub minute: u8,
796-
pub second: u8,
796+
pub second: f64,
797797
}
798798

799799
impl TdbDataType for Duration {
@@ -825,7 +825,7 @@ impl FromLexical<Duration> for Duration {
825825
let day = u8::from_lexical(&mut b);
826826
let hour = u8::from_lexical(&mut b);
827827
let minute = u8::from_lexical(&mut b);
828-
let second = u8::from_lexical(b);
828+
let second: f64 = <f64 as FromLexical<f64>>::from_lexical(&mut b);
829829
Duration {
830830
sign,
831831
year,
@@ -854,7 +854,7 @@ fn duration_string(duration: &Duration) -> String {
854854
} else {
855855
"".to_string()
856856
};
857-
if duration.hour == 0 && duration.minute == 0 && duration.second == 0 {
857+
if duration.hour == 0 && duration.minute == 0 && duration.second == 0.0 {
858858
format!("P{year}{month}{day}")
859859
} else {
860860
let hour = if duration.hour != 0 {
@@ -867,7 +867,7 @@ fn duration_string(duration: &Duration) -> String {
867867
} else {
868868
"".to_string()
869869
};
870-
let second = if duration.second != 0 {
870+
let second = if duration.second != 0.0 {
871871
format!("{}S", duration.second)
872872
} else {
873873
"".to_string()

0 commit comments

Comments
 (0)