Skip to content

Commit ae1d94c

Browse files
Remove erroneous Z in RFC epoch format const
Also remove the Kani visualizations -- if it fails I run it in VSCode or locally Signed-off-by: Christopher Rabotin <[email protected]>
1 parent 3410cfd commit ae1d94c

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

.github/workflows/formal_verification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# Remove `cdylib` from targets in Cargo.toml because it confuses Kani
3838
sed '17d' Cargo.toml > Cargo.toml.new
3939
mv Cargo.toml.new Cargo.toml
40-
cargo kani | (cargo kani --visualize && exit 1) # Re-run for artifacts if it has failed.
40+
cargo kani
4141
4242
- name: Save formal verification artifacts
4343
uses: actions/upload-artifact@v3

src/efmt/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub const RFC3339: Format = Format {
176176
Some(Item {
177177
token: Token::Second,
178178
sep_char: Some('.'),
179-
second_sep_char: Some('Z'),
179+
second_sep_char: None,
180180
optional: false,
181181
}),
182182
Some(Item {

src/efmt/format.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ impl Format {
185185
ts = TimeScale::from_str(s[idx..].trim())?;
186186
}
187187
break;
188+
} else if char == 'Z' {
189+
// This is a single character to represent UTC
190+
// UTC is the default time scale, so we don't need to do anything.
191+
break;
188192
}
189193
prev_item = cur_item;
190194
prev_token = cur_token;

tests/epoch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ fn test_epoch_formatter() {
18031803
let init_str = "1994-11-05T08:15:30-05:00";
18041804
let e = Epoch::from_str(init_str).unwrap();
18051805

1806-
let fmt = Format::from_str("%Y-%m-%dT%H:%M:%S.Z%f%z").unwrap();
1806+
let fmt = Format::from_str("%Y-%m-%dT%H:%M:%S.%f%z").unwrap();
18071807
assert_eq!(fmt, RFC3339);
18081808

18091809
let fmtd = Formatter::with_timezone(e, Duration::from_str("-05:00").unwrap(), RFC3339_FLEX);

0 commit comments

Comments
 (0)