Skip to content

Commit

Permalink
types: duration: Deal with empty as PT0S
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Sep 19, 2024
1 parent d945dca commit dd027ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xsd-types/src/types/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ impl FromStr for Duration {

let mut dur: Duration = Default::default();
let mut context = ParsingContext::new();

if s.is_empty() {
return Ok(dur);
}

for (i, c) in s.chars().enumerate() {
match c {
'-' => {
Expand Down

0 comments on commit dd027ab

Please sign in to comment.