File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -793,7 +793,7 @@ pub struct Duration {
793
793
pub day : u8 ,
794
794
pub hour : u8 ,
795
795
pub minute : u8 ,
796
- pub second : u8 ,
796
+ pub second : f64 ,
797
797
}
798
798
799
799
impl TdbDataType for Duration {
@@ -825,7 +825,7 @@ impl FromLexical<Duration> for Duration {
825
825
let day = u8:: from_lexical ( & mut b) ;
826
826
let hour = u8:: from_lexical ( & mut b) ;
827
827
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) ;
829
829
Duration {
830
830
sign,
831
831
year,
@@ -854,7 +854,7 @@ fn duration_string(duration: &Duration) -> String {
854
854
} else {
855
855
"" . to_string ( )
856
856
} ;
857
- if duration. hour == 0 && duration. minute == 0 && duration. second == 0 {
857
+ if duration. hour == 0 && duration. minute == 0 && duration. second == 0.0 {
858
858
format ! ( "P{year}{month}{day}" )
859
859
} else {
860
860
let hour = if duration. hour != 0 {
@@ -867,7 +867,7 @@ fn duration_string(duration: &Duration) -> String {
867
867
} else {
868
868
"" . to_string ( )
869
869
} ;
870
- let second = if duration. second != 0 {
870
+ let second = if duration. second != 0.0 {
871
871
format ! ( "{}S" , duration. second)
872
872
} else {
873
873
"" . to_string ( )
You can’t perform that action at this time.
0 commit comments