Commit graph

334 commits

Author SHA1 Message Date
Eric Huss f822f4661b Allow zero-prefixed float exponents. (#322) 2019-08-23 09:55:15 -07:00
Nick Hackman c18d474acf Propogate write! errors to ser::Error
std::fmt::Errors are now converted to ser::Errors via ser::Error::custom
2019-08-20 12:59:28 -04:00
Nick Hackman 9f25cfa17b Fixed Clippy warning of long return type
Created an alias named TablePair being a (Cow<'a, str>, Value<'a>)
2019-08-18 21:07:23 -04:00
Nick Hackman 6699b5be03 Potential Solution to drop clippy errors
Calling the write!, the result that it returns doesn't matter or wasn't
deemed as important and was dropped before. This was just removed and
then the unused Result is ignored via clippy attribute. This is a
plausible solution to get past the Clippy Error, but others may be more
ideal.
2019-08-18 20:23:40 -04:00
Nick Hackman 8b88c96cfc Removed all warnings besides two
Majority of warnings removed via RustFix
Two remain one being a long return type and another being a name
suggestion from Clippy `to_owned` for MaybeString
2019-08-14 23:05:30 -04:00
Eric Huss 514b8ca8f2 Fix error line/column when using CRLF line endings. 2019-08-13 13:48:54 -07:00
Nick Hackman 64e2f4742f Simplified Logic when comparing discriminants
Removed matches that were used to compare Enum variants for equality in
favor of using discriminant from https://doc.rust-lang.org/std/mem/fn.discriminant.html
introduced in Rust 1.21.0
2019-08-13 14:13:01 -04:00
Jason Priest 4018ebc65a Derive Clone+PartialEq for Spanned
Should any other traits be derived?
2019-08-12 21:27:26 -05:00
Alex Crichton fd39bc7412 Run cargo fmt 2019-08-12 13:50:59 -07:00
Alex Crichton 59c0d52600 Fix a bad merge 2019-08-12 13:50:44 -07:00
Alex Crichton 7a11ed691a Merge pull request #315 from jwdeitch/master
Allow conversion from de::Error to std::io::error
2019-08-12 15:35:55 -05:00
Alex Crichton 7e8b40b025 Merge pull request #314 from zertosh/add-line-and-col-to-errors
Add line and column to all Errors
2019-08-12 15:35:35 -05:00
Eric Huss 5cb9b37b99 Squelch explicit_outlives_requirements warning. 2019-08-12 09:12:39 -07:00
Pietro Albini c6745eeaeb include Spanned in the docs
The `Spanned` struct was originally included in the docs as a re-export,
but rustdoc doesn't render re-exports if the module from which it's
exported isn't documented.

Since `Spanned` is the only public item inside the `spanned` module this
commit shows the struct as a normal item in the index, and moves the
example from the module docs to the struct docs.
2019-08-09 20:48:46 +02:00
Jordan Deitch d3eedc52ba convert toml error to std::io error 2019-08-01 20:43:05 -04:00
Andres Suarez b09bb78352 Add line and column to all Errors 2019-07-30 13:35:08 -04:00
Andres Suarez 8c1b49f66f Show "column" in Error messages 2019-07-28 13:41:17 -04:00
Eric Huss 8f115c98d3 cargo fmt 2019-05-08 17:45:39 -07:00
Eric Huss 0737f0b27a 2018 edition idioms. 2019-05-08 17:37:38 -07:00
Eric Huss 68fd59c78d Migrate to 2018 edition. 2019-05-08 12:12:14 -07:00
Eric Huss 10fb80090c Bump html_root_url version. 2019-04-25 11:15:42 -07:00
Constantin Nickel a622bd414c implement From<toml::value::Table> for toml::Value 2019-04-08 23:58:16 +02:00
Eric Huss 816b457c84 Fix float with invalid suffix. 2019-04-05 13:51:28 -07:00
Eric Huss 743cfcef05 Merge pull request #295 from ErichDonGubler/fix_warnings
Fix warnings for deprecated usages of trim_{left,right}_matches.
2019-04-02 10:50:33 -07:00
Erich Gubler d34e734b39 Fix warnings for deprecated usages of trim_{left,right}_matches. 2019-04-02 09:35:28 -06:00
Erich Gubler a6071c7aac Make importing toml_internal macro unnecessary when using the toml macro 2019-04-02 09:32:51 -06:00
Tomasz Miąsko a5046008e5 Fix parsing of repeated delimiters inside multi-line strings
The previous implementation of `read_string`, when looking for
delimiters ending the multi-line string and failing to find exactly
three in succession, always put a single delimiter back. This is
incorrect when exactly two delimiters are present.

Put back the correct number of delimiters depending on how many have
been already consumed from input.

The issue could be triggered only with `Owned` representation of
`MaybeString`, since otherwise `push` operation is no-op.
2019-03-20 17:58:14 +01:00
Abid Omar 861a7be7d4 Add PartialEq to Toml::de
Add PartialEq trait to Error, ErrorInner and ErrorKind.

Relevant issue: https://github.com/alexcrichton/toml-rs/issues/291
2019-03-11 18:38:50 +01:00
Eric Huss b7493c9bef Fix case sensitivity with T, Z, and E. 2019-02-19 10:59:42 -08:00
Alex Crichton 7c969432ad Merge pull request #278 from Kerollmops/master
Add the preserve_order feature (rebased version)
2019-01-08 15:24:40 -08:00
Alex Crichton 184d16b4a3 Fix disallowing duplicate table headers
This commit fixes #279 where a case of duplicate table headers slipped
through the cracks. This also adds an option to disable this new
validation to allow Cargo to preserve backwards compatibility.
2019-01-07 09:06:04 -08:00
Vincent Prouillet 8621ab27ae Add the preserve_order feature 2018-12-28 14:42:55 +01:00
Alex Crichton cbfc4e18f8 Run cargo fmt 2018-12-17 17:45:35 -08:00
Alex Crichton 7845df9ff9 Merge pull request #264 from azriel91/feature/225/externally-tagged-enums
Issue 255: Externally tagged enum deserialization
2018-11-28 09:50:38 -06:00
Alex Crichton 88be3b70a7 Merge pull request #276 from ehuss/fix-version
Indicate this is now supporting version 0.5 of TOML.
2018-11-21 11:55:29 -06:00
Eric Huss 57e78ee3bc Indicate this is now supporting version 0.5 of TOML. 2018-11-21 09:41:57 -08:00
Eric Huss b21dd8cf05 Fix trailing space after date.
The space between date and time was being eagerly skipped when it shouldn't.
2018-11-21 09:35:50 -08:00
Azriel Hoh cd6373a9ab Maintain backward compatibility with Rust 1.15, take 3. 2018-11-17 14:19:14 +13:00
Azriel Hoh 752bf0d4a1 Only validate table keys against fields when deserializing enum.
Issue #225
2018-11-17 13:37:24 +13:00
Azriel Hoh 5bcf6f7cb6 Maintain compatibility with Rust 1.15
Issue #225
2018-11-17 13:36:38 +13:00
Azriel Hoh 1656e2e51d Error when deserializing struct if encountering unknown fields.
Issue #225
2018-11-12 10:09:30 +13:00
Azriel Hoh a0295b3308 Maintain compatibility with Rust 1.15
Issue #225
2018-11-10 11:10:34 +13:00
Azriel Hoh a4928a47a8 Implemented deserialization for external enums.
Issue #225
2018-11-10 11:10:31 +13:00
Azriel Hoh 7777c1452f Better error handling when parsing tuples.
Issue #225
2018-11-10 11:07:26 +13:00
Azriel Hoh 4f28c2f639 Implemented enum tuple deserialization.
Issue #225
2018-11-10 11:07:23 +13:00
Azriel Hoh f5d14af5a6 Implement deserialization for unit and struct variants.
Issue #225
2018-11-10 11:06:34 +13:00
Alex Crichton 80d2cf081d Merge pull request #271 from spease/allow-newtype-key
Allow newtype key
2018-10-29 09:57:55 -07:00
Alex Crichton 14f8934bef Merge pull request #268 from jmhain/allow-ws-after-bs
Allow whitespace after line ending backslash (#162)
2018-10-29 09:47:56 -07:00
hcpl 5636a7430e Support tuple Serde types for Value 2018-10-28 12:36:40 +02:00
Steven Pease d75c9ccd00 Allow newtype key 2018-10-27 18:28:18 -07:00