@@ -520,9 +520,18 @@ impl sealed::Sealed for Rfc3339 {
520
520
let input = exactly_n_digits :: < 2 , _ > ( input)
521
521
. and_then ( |item| item. consume_value ( |value| parsed. set_day ( value) ) )
522
522
. ok_or ( InvalidComponent ( "day" ) ) ?;
523
- let input = ascii_char_ignore_case :: < b'T' > ( input)
524
- . ok_or ( InvalidLiteral ) ?
525
- . into_inner ( ) ;
523
+
524
+ // RFC3339 allows any separator, not just `T`, not just `space`.
525
+ // cf. Section 5.6: Internet Date/Time Format:
526
+ // NOTE: ISO 8601 defines date and time separated by "T".
527
+ // Applications using this syntax may choose, for the sake of
528
+ // readability, to specify a full-date and full-time separated by
529
+ // (say) a space character.
530
+ // Specifically, rusqlite uses space separators.
531
+ let input = input
532
+ . get ( 1 ..)
533
+ . ok_or_else ( || InvalidComponent ( "separator" ) ) ?;
534
+
526
535
let input = exactly_n_digits :: < 2 , _ > ( input)
527
536
. and_then ( |item| item. consume_value ( |value| parsed. set_hour_24 ( value) ) )
528
537
. ok_or ( InvalidComponent ( "hour" ) ) ?;
@@ -618,9 +627,18 @@ impl sealed::Sealed for Rfc3339 {
618
627
let input = dash ( input) . ok_or ( InvalidLiteral ) ?. into_inner ( ) ;
619
628
let ParsedItem ( input, day) =
620
629
exactly_n_digits :: < 2 , _ > ( input) . ok_or ( InvalidComponent ( "day" ) ) ?;
621
- let input = ascii_char_ignore_case :: < b'T' > ( input)
622
- . ok_or ( InvalidLiteral ) ?
623
- . into_inner ( ) ;
630
+
631
+ // RFC3339 allows any separator, not just `T`, not just `space`.
632
+ // cf. Section 5.6: Internet Date/Time Format:
633
+ // NOTE: ISO 8601 defines date and time separated by "T".
634
+ // Applications using this syntax may choose, for the sake of
635
+ // readability, to specify a full-date and full-time separated by
636
+ // (say) a space character.
637
+ // Specifically, rusqlite uses space separators.
638
+ let input = input
639
+ . get ( 1 ..)
640
+ . ok_or_else ( || InvalidComponent ( "separator" ) ) ?;
641
+
624
642
let ParsedItem ( input, hour) =
625
643
exactly_n_digits :: < 2 , _ > ( input) . ok_or ( InvalidComponent ( "hour" ) ) ?;
626
644
let input = colon ( input) . ok_or ( InvalidLiteral ) ?. into_inner ( ) ;
0 commit comments