Commit Graph

528 Commits

Author SHA1 Message Date
Trangar 09e7a6265d Release v2.0.0-beta.1 (#484) 2022-01-19 19:11:35 +01:00
Trangar a00f37ee59 Migration guide (#482)
* Added a guide on how to migrate from bincode 1 to 2

* Removed unneeded dependency on bincode 1

* Processed feedback

* Added a link to the migration guide, added `#[cfg(doc)]` to the doc modules
2022-01-19 19:04:20 +01:00
Trangar d13d177bea made the serde functions consistent with the base bincode functions (#483) 2022-01-19 18:57:52 +01:00
Trangar fc1f3acdcb Feature/improve serde (#477)
* Made serde able to be used with alloc and no_std targets

* Processed feedback
2022-01-19 18:14:21 +01:00
Trangar 59b787cbf8 Moved Configuration::standard() and ::legacy() to the config module (#481)
* Moved Configuration::standard() and ::legacy() to the config module

* Fixed issue with config that would overwrite the limit, added a checklist on adding config variables
2022-01-19 16:46:25 +01:00
Trangar a5e57d51d8 Update documentation (#480)
* Updated documentation

* Updated spec.md
2022-01-18 15:17:58 +01:00
Trangar f3c21f2245 Made SerdeDecoder attempt to allocate a string before complaining about being able to decode borrowed data (#475) 2022-01-17 17:16:14 +01:00
Trangar c1e9828e7d Implemented the newly stabilized CString::from_vec_with_nul method (#473) 2022-01-13 20:52:51 +01:00
Lena Hellström 8106eadf66 Switch Encode to take &mut E (#471) 2022-01-13 12:26:09 +01:00
Trangar 4149c0f29f Switched Decode and BorrowDecode to take &mut D (#470)
* Switched Decode and BorrowDecode to take &mut D, fixes #467

* I didn't forget to run cargo fmt, you did
2022-01-11 20:23:31 +01:00
5225225 4450fd40a4 Add fuzzing harness, try to decode into various types (#468)
* WIP adding fuzzing

* Check for round trips (BinaryHeap isn't PartialEq)

* Expand globs

* Rename fuzzing target
2022-01-10 19:17:24 +01:00
5225225 39ba03b2e5 Fix panic with invalid system time (#469) 2022-01-09 14:54:51 +01:00
5225225 236d350f13 Fix overflow error when deserializing invalid Duration (#465)
* Fix overflow error when deserializing invalid Duration

* Use unwrap_err instead of match in test
2022-01-08 22:54:04 +01:00
Trangar a08e528cc7 Release v2.0.0-beta.0 (#464) 2022-01-08 15:42:49 +01:00
Trangar 99707d0d0b Fixed derive impl on an empty enum (#462)
* Fixed derive impl on an empty enum

* Added DecodeError::EmptyEnum in case a user tries to decode an empty enum
2022-01-08 12:39:03 +01:00
Trangar 030905e7d5 Bump virtue 0.0.4 (#463)
* Updated breaking virtue changes in preperation of virtue 0.0.4 release

* Added contents of derive.rs test_macro_newtype
2022-01-08 12:11:24 +01:00
Trangar 5e9186ea8f Updated readme for bincode 2. Added a paragraph on why we don't support #[repr(u8)] (#461) 2022-01-03 19:53:12 +01:00
ygf11 f2d2fc05a8 Fix varint bench failed (#457) 2021-12-22 17:38:57 +01:00
Popog dbb9a43ccd feat: Make `Configuration` functions `const` (#456) 2021-12-16 09:53:15 +01:00
Trangar 45c0fa7782 Release v2.0.0-alpha.2 (#455) 2021-12-14 15:27:40 +01:00
Trangar 7690da5203 Made the derive macros automatically implement the required traits on generic arguments (#454) 2021-12-14 15:18:13 +01:00
Trangar a5255465bd Made the CI also check the benchmarks, fixed compile issue in benchmarks (#449) 2021-12-11 16:09:23 +01:00
Trangar 0ee07c3212 Extract virtue (#443) 2021-12-11 15:58:49 +01:00
Trangar 404946f12b [Breaking change] Made all `decode_from_slice` also return the number of bytes read (#445) 2021-12-11 15:51:50 +01:00
Trangar 63f4607992 Feature/config limit (#439)
* Added Limit<N> and NoLimit to the configuration
* Added a limit check to Decoder and DecoderImpl
* Added test cases, added a helper function specialized for containers
* Added a test to see if inlining makes the limit config faster, added inlining to the decoder
2021-12-11 15:44:43 +01:00
李冬冬 ed57fd0810 Impl BorrowDecode for Option<&[u8]> and Option<&str> (#446)
Co-authored-by: Trangar <victor.koenders@gmail.com>
2021-12-10 19:50:24 +01:00
Trangar bb3612103a Fixed clippy warnings (#447) 2021-12-10 17:39:35 +01:00
Trangar 7cb10d4ab3 Added test case for a borrowed str (#441) 2021-12-02 11:44:08 +01:00
Trangar 4be23b88de Added Decode/Encode for HashMap<K, V> (#438) 2021-11-22 15:18:58 +01:00
Trangar c4fd7efa49 Release 2.0.0-alpha.1 (#435) 2021-11-09 10:15:12 +01:00
Trangar ad7ddebff3 Allow serde types to be Decode/Encoded (#434)
* Added support for #[bincode(serde)] attribute on fields, added SerdeToBincode helper struct

* Switch to using Compat/BorrowCompat

* Moved all the serde features and functions to its own module

* Fix broken link

* Added support for the bincode(with_serde) attribute in enum variants

* Updated the main documentation on serde, fixed an example not compiling under certain feature flag combinations

* Added #[serde(flatten)] to the list of problematic attributes

* Added better error reporting on invalid attributes
2021-11-09 10:08:47 +01:00
Trangar 8c1279feab functions to enable encoding/decoding serde types (#422)
* functions to enable encoding/decoding serde types
* Removed dev feature I forgot to remove
* Centralized option variant and len() decoding/encoding
2021-11-08 12:38:29 +01:00
Trangar cc13be30d4 split off BorrowDecode from Decode in bincode_derive (#432)
* split off BorrowDecode from Decode in bincode_derive

* Added test case for issue #431

* Fixed Cow implementation having the wrong constraint, added BlockedTODO for cow implementation specialization

* Re-exported the Decode and Encode traits in the crate root

* Removed outdated comments

* Removed some :🇩🇪:Decode that were introduced by the merge
2021-11-07 10:57:35 +01:00
Trangar b4c46a789a Fixes for 427 (#428)
* Made bincode_derive handle empty lines of docs correctly
* Made bincode_derive properly support const generics
* Added support for enums with variants with fixed values
2021-11-07 10:31:15 +01:00
Andre Nathan 7174f6422d Generate qualified Result type in derive (#430) 2021-11-05 18:07:13 +01:00
Seppel3210 e54a47cf14 Fix some typos (#423) 2021-10-25 16:24:57 +02:00
Trangar 73616a3d62 Made the zigzag encoding examples compile and run (#421)
Made the zigzag encoding examples compile and run
2021-10-25 11:24:50 +02:00
Trangar b30805dde2 Replace test-all-features with a manual CI matrix (#419)
Made the rust CI pipeline use a matrix instead of test-all-features
Removed beta and nightly from the test pipelines, made the check pipeline check on --all-features
2021-10-25 11:19:46 +02:00
Lena Hellström e81665bbea Add necessary metadata to bincode_derive (#420) 2021-10-25 10:57:37 +02:00
Lena Hellström c6ba4ffc88 Update authors to reflect current code state (#418) 2021-10-25 10:39:58 +02:00
Trangar 0c13c891c5 Updated readme.md and added a test for the examples (#417)
* Updated readme.md and added a test for the examples

* Removed tests/readme.rs and made the readme doctest a (hidden) part of lib.rs
2021-10-25 10:26:23 +02:00
Lena Hellström f09d839d10 Merge pull request #413 from bincode-org/feature/deserde
Feature/deserde
2021-10-24 19:43:59 +02:00
Victor Koenders 382b2c7a8f Fixed clippy lint, removed function that was only used in 1 place 2021-10-24 18:06:16 +02:00
Lena Hellström 99de47a6c8 Reintroduce varint optimizations 2021-10-24 16:44:36 +02:00
Lena Hellström 62b8f39f8f Optimize performance of decoding u8 arrays 2021-10-22 14:47:44 +02:00
Lena Hellström 539906f441 Optimize performance of slice writing 2021-10-22 14:47:05 +02:00
Victor Koenders 0be7e2f4f2 Updated to edition 2021 2021-10-21 17:34:56 +02:00
Victor Koenders bd994e354d Updated documentation of Encode, added an example to lib.rs 2021-10-21 14:45:16 +02:00
Victor Koenders dae645f675 Joined the 2 Sealed traits into a single one 2021-10-21 14:27:03 +02:00
Victor Koenders 707d0d238f Made all encode and decode functions always require a Config, removed _with_config functions 2021-10-21 14:19:40 +02:00