Comments (5)
Options
- Revert the change
- Add a feature flag for full date validation, which pulls in chrono
- Do nothing (like
toml-rs
)
from toml.
Curious how other parsers handle that (e.g. in other languages). It seems toml spec specifies the date should follow the https://datatracker.ietf.org/doc/html/rfc3339. And if chrono panics on construction instead of returning an error, that's not good either, but I would lean towards Do nothing and documenting this behavior.
from toml.
Chrono offers panicing and Option
variants of its constructors
Looking at the RFC, it seems like it shouldn't be too bad to address days of month. I assume the complexity in chrono is coming from other functionality.
Leap seconds is an interesting one. If you don't bother with a lookup table, it simplifies things but knowing whether you can have a leap second or not is dependent on the month. So a date-less time can't do validation and combining a date and time can error.
from toml.
As for other languages, toml-test
validates that toml parsers reject months with 50 days but doesn't validate further. So parsers using that test (like go) at least validate that much.
Python's toml
loads into datetime
which handles leap years. I did not verify how it handles leap seconds
from toml.
If my preference is at all useful here, I would like chrono
behind a feature flag if you intend to add it again.
The project where I use toml_edit
already has a ton of dependencies. And while chonro
is not large compared to everything else I depend on, I do try to keep the tree as thin as possible by removing unnecessary features. A feature flag would just be really nice to have.
from toml.
Related Issues (20)
- The bump on MSRV is preventing `toml_datetime` been use in old system HOT 1
- Expose line and column in deserialization errors HOT 2
- Bad span when a root field is a map instead of a table
- Comments between lines in a table are duplicated HOT 4
- Dependency on GLIBC introduced by toml::to_string function HOT 1
- Document `Item::None` return values HOT 1
- Examples need improvement - missing basic example that reads from a file, not a string variable. HOT 1
- toml_edit: Confusing deprecation message - decor_mut states it's deprecated in favour of itself
- Deprecated field warning during deserialization HOT 4
- Inconsistencies between documentation and code implementation HOT 2
- Replacing an `InlineTable` with a comment with a `Table` results in invalid syntax HOT 2
- inclusion of another toml file and variable substitution HOT 2
- Time doesn't implement Serialize and Deserialize HOT 5
- Remove `Item` support from `Document`s API HOT 2
- Stack Overflow with Specific Optimization Levels When Running Test Cases HOT 6
- Fix u64 deserialization HOT 6
- Multi-line k/v pairs HOT 1
- Serialization of keys varies depending on whether the feature flag "parse" is enabled
- Array of Tables `remove` does not return the removed table
- Implement `From<inner type>` for `Item`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toml.