Commit Graph

20 Commits

Author SHA1 Message Date
Lena Hellström 2c87442fe6 Decode context (#749)
Add an optional context for decoding allowing additional data to be passed to decoded structs.

---------

Co-authored-by: branchseer <dk4rest@gmail.com>
2025-03-06 09:54:43 +00:00
Trangar dc468b4bed Made arrays never encode their length (#625)
* Made arrays with 32 elements or less never encode their length

* Removed `write_fixed_array_length` and `skip_fixed_array_length` as this was based on incorrect assumptions on how serde and bincode 1 works

---------

Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-03-30 15:09:33 +02:00
Trangar 3aa269bfea Fixed new clippy warnings (#617)
* Fixed new clippy warnings

* Undid breaking all the tests

* Fixed more clippy warnings

---------

Co-authored-by: Victor Koenders <git@trang.ar>
2023-03-30 11:06:34 +02:00
Trangar 974abe8661 Fixed the clippy Eq warning. (#574)
Added DecodeError::Io
Removed `PartialEq` on DecodeError
2022-08-18 15:57:18 +02:00
Trangar 86e03aeda7 Rewrite: seperated Decode and BorrowDecode (#526)
* Rewrite: seperated Decode and BorrowDecode

* Fixed cargo.toml issues

* Fixed clippy warning

* Removed the `impl_tuples` macro call with manually exported code

* Replaced the generated code in `impl_tuples` with the macro instead

* Implemented BorrowDecode for Box<[T]>

* Added a test to see if zoxide can be ported to bincode 2

* Added a test for Arc<str>

* Made several `Encode` implementations require `T: ?Sized`

* Implemented Decode for Arc<str>

* Added BlockedTODO links to commented out code

* Fixed clippy and lint issues

* Updated virtue dependency in fuzz lockfile
2022-06-04 15:23:55 +02:00
Lena Hellström f979383adb Fix tuple struct encoding in serde (#549) 2022-06-04 14:56:20 +02:00
Trangar e7d2292dc2 Switched to weak dependencies (#538)
* Switched to weak dependencies

* Removed old `serde_impl` references

* Fixed CI and updated documentation

* Fixed a cfg for a test

* Removed unneeded package in Cargo.toml
2022-05-21 14:19:13 +02:00
Trangar 03450ac49f Made config::standard() implement .write_fixed_array_header() by default (#509)
* Made config::standard() implement .write_fixed_array_header() by default

* Fixed failing unit test

* Fixed formatting
2022-02-28 17:26:46 +01:00
Trangar 58dc788dfa Fix/issue 500 (#503)
* Fixed an issue where serde would decode a sequence with an u32 instead of a usize

* Added serde to the `the_same` test for roundtrips, fixed several issues.

* Fixed backwards compatibility for result, ipv4addr and ipv6addr

* Processed feedback
2022-02-07 16:52:15 +01:00
Trangar d0fd1a98cd Fixed an error in bincode derive where it would implement the wrong trait if a generic parameter is present (#487)
* Fixed an error in bincode derive where it would implement the wrong trait if a generic parameter is present

* Reorganized the derive tests, added a roundtrip test for an enum with generics

* I didn't forget cargo fmt I swear

* Simplified some paths
2022-01-23 10:10:36 +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 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 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
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
Victor Koenders 151edf46d3 Included spec.md into cargo's documentation, fixed the issues, changed the [u8; N] implementations to [T; N] 2021-10-21 11:57:16 +02:00
Lena Hellström 684f2562b1 Config rewrite (#412)
Rewrite the config system to be slightly more friendly to adding new options
2021-10-17 21:07:31 +02:00
Lena Hellström e232454936 Refactor and rename encoders 2021-10-17 16:22:14 +02:00
Victor Koenders 1f261cede3 Added support for atomic integers 2021-10-16 14:49:18 +02:00
Victor Koenders 33dd4f761d Added support for CStr and CString 2021-10-16 12:59:38 +02:00
Victor Koenders 07f49e878e Added support for Vec<T>, Box<T> and Box<[T]> 2021-10-16 11:41:59 +02:00