Skip to content

Patched the parsing code that uses time and bumped the rust version#256

Open
tunafysh wants to merge 1 commit into
rwf2:masterfrom
tunafysh:master
Open

Patched the parsing code that uses time and bumped the rust version#256
tunafysh wants to merge 1 commit into
rwf2:masterfrom
tunafysh:master

Conversation

@tunafysh

Copy link
Copy Markdown
  • Patched the code in src/parse.rs from format.parse(s.as_bytes()) to format.parse(s.as_bytes(), None)by providing the value None to the defaults argument.
  • Also bumped the rust version from 1.85 to 1.88 because time 0.3.52 requires it.

@dns2utf8

Copy link
Copy Markdown

Until this is merged:

[patch.crates-io]
cookie = { git = "https://github.com/tunafysh/cookie-rs/", rev = "45612d0f23e0a077ab9c78280770ba06037e5437" }

@msrd0

msrd0 commented Jun 30, 2026

Copy link
Copy Markdown

I don't think this should be fixed here but rather in the time crate. The accidental breaking change has already been reported there: time-rs/time#794

@krishna-santosh

Copy link
Copy Markdown

I don't think this should be fixed here but rather in the time crate. The accidental breaking change has already been reported there: time-rs/time#794

time-rs/time#793 (comment)

@SamRodri

Copy link
Copy Markdown

I think a better fix would be time::Date::parse(s, format) because the Parsable::parse method is not public API

Comment thread src/parse.rs

pub(crate) fn parse_date(s: &str, format: &impl Parsable) -> Result<OffsetDateTime, time::Error> {
// Parse. Handle "abbreviated" dates like Chromium. See cookie#162.
let mut date = format.parse(s.as_bytes())?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution probably should not continue to use the undocumented method with no semver guarantees. Relevant comment from the time maintainers: time-rs/time#793 (comment)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but this is meant as a temporary replacement as tauri is literally refusing to build.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "temporary replacement" will be broken in the future. It is not the solution you think it is. You will not get an extraordinarily clear deprecation warning.

@joshka

joshka commented Jul 2, 2026

Copy link
Copy Markdown

See master...joshka:cookie-rs:joshka/avoid-private-time-parsing for a better approach to this that both fully avoids the problem and adds more testing to show that the parts involved are properly covered. More details in the #255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants