Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't let unstable-locales imply the alloc feature #1307

Merged
merged 2 commits into from
Sep 23, 2023

Conversation

pitdicker
Copy link
Collaborator

I hope that at some point we add support for parsing different locales (should not be all that hard). And that we can make the new formatting API work without alloc (proven to be possible in #1163).

In both cases it does not make much sense for the unstable-locales feature to imply the alloc feature.

This will break uses of chrono with no-default-features with the unstable-locales feature, that happen to also depend on alloc.
I feel we are allowed to make this change because of the name unstable-locales.

Split out from #1163.

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Merging #1307 (94d9e65) into 0.4.x (41e34ad) will not change coverage.
Report is 1 commits behind head on 0.4.x.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##            0.4.x    #1307   +/-   ##
=======================================
  Coverage   91.00%   91.00%           
=======================================
  Files          38       38           
  Lines       17068    17068           
=======================================
  Hits        15533    15533           
  Misses       1535     1535           
Files Changed Coverage Δ
src/date.rs 35.86% <ø> (ø)
src/datetime/tests.rs 96.50% <ø> (ø)
src/format/formatting.rs 87.83% <ø> (ø)
src/format/mod.rs 85.04% <ø> (ø)
src/format/strftime.rs 98.94% <ø> (ø)
src/naive/datetime/tests.rs 98.63% <ø> (ø)
src/naive/isoweek.rs 98.16% <ø> (ø)
src/datetime/mod.rs 86.25% <100.00%> (ø)
src/format/parse.rs 97.24% <100.00%> (ø)
src/lib.rs 95.58% <100.00%> (ø)
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pitdicker pitdicker force-pushed the unstable_locales_no_alloc branch 2 times, most recently from f40e155 to b0adf08 Compare September 22, 2023 18:19
@pitdicker
Copy link
Collaborator Author

All localized formatting methods now also depend on alloc or std.
StrftimeItems::new_with_locale becomes available on no_std.

@pitdicker pitdicker changed the title Don't make unstable-locales depend on alloc feature Don't let unstable-locales imply the alloc feature Sep 22, 2023
@djc
Copy link
Member

djc commented Sep 23, 2023

I'm okay with this, but any(feature = "alloc", feature = "std") is silly because std should imply alloc.

@pitdicker
Copy link
Collaborator Author

I'm okay with this, but any(feature = "alloc", feature = "std") is silly because std should imply alloc.

It did not bother me enough yet 😄. I have added a commit to clean that up.

@pitdicker pitdicker merged commit 68a141e into chronotope:0.4.x Sep 23, 2023
37 checks passed
@pitdicker pitdicker deleted the unstable_locales_no_alloc branch September 23, 2023 11:12
@pitdicker
Copy link
Collaborator Author

Nice, this also reduced the number of feature combinations the CI tests with 35%.

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.

2 participants