Commit Graph

655 Commits

Author SHA1 Message Date
Trangar 0d7e7950cb Fixed a new clippy warning (#661)
Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-09-15 13:37:27 +02:00
dependabot[bot] db10782141 Bump actions/checkout from 3 to 4 (#660)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 12:33:36 +02:00
dullbananas 70b22d4dc0 Allow generics in impl_borrow_decode (#635)
* Allow generics in impl_borrow_decode

* Use impl_borrow_decode for PhantomData

* Update impls.rs

* Update mod.rs
2023-06-19 15:46:45 +02:00
dependabot[bot] b7f944816b Bump actions/upload-artifact from 1 to 3 (#651)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 15:01:35 +02:00
dependabot[bot] 403bc28e4f Update virtue requirement from 0.0.13 to 0.0.14 (#645)
* Update virtue requirement from 0.0.13 to 0.0.14

Updates the requirements on [virtue](https://github.com/bincode-org/virtue) to permit the latest version.
- [Release notes](https://github.com/bincode-org/virtue/releases)
- [Commits](https://github.com/bincode-org/virtue/compare/v0.0.13...v0.0.14)

---
updated-dependencies:
- dependency-name: virtue
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Removed redundant clone

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Victor Koenders <git@trang.ar>
2023-06-04 11:24:58 +02:00
dependabot[bot] 602d5137bf Update criterion requirement from 0.4 to 0.5 (#641)
Updates the requirements on [criterion](https://github.com/bheisler/criterion.rs) to permit the latest version.
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bheisler/criterion.rs/compare/0.4.0...0.5.0)

---
updated-dependencies:
- dependency-name: criterion
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 08:44:21 +02:00
dependabot[bot] ad6cf2518a Update criterion requirement from 0.3 to 0.4 (#637) 2023-05-17 09:53:12 +00:00
dependabot[bot] 42dd409cd5 Update glam requirement from 0.21 to 0.24 (#640) 2023-05-17 09:23:46 +00:00
dependabot[bot] 1143290ee1 Bump codecov/codecov-action from 2 to 3 (#639) 2023-05-17 08:31:08 +00:00
dependabot[bot] 42c88715be Bump actions/checkout from 1 to 3 (#638) 2023-05-17 07:40:41 +00:00
Trangar c94d2e73ee Added dependabot (#636)
Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-05-17 08:56:48 +02:00
Lachezar Lechev 48783ba725 fix(doc): broken intra link (#634) 2023-05-14 13:15:00 +00:00
Luke Stadem 4597e0f5bb Fix typos in Spec.md enum example (#630)
In the Enums section, there are examples using the second and third variants of an enum, but the comment incorrectly refers to them as "first variant".

Unless perhaps the intention here was to say "the variant is first"?
2023-04-07 10:26:45 +02:00
Trangar 958b439c38 Release rc.3 (#628)
Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-03-30 16:12:47 +02: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 af4697e1fb Disabled i686-linux-andoid and x86_64-linux-android CI as they fail for external reasons (#627)
Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-03-30 14:10:53 +02:00
Trangar a6a5c41038 Bumped virtue to 0.0.13 (#626)
Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-03-30 13:08:23 +02:00
Trangar 9880abe499 Improved encoding and decoding speed of Vec<u8> (#619)
* Improved encoding and decoding speed of Vec<u8>

* Added black_box calls to benches/string.rs
Added a SizeWriter because someone finally has a benchmark to show it's faster

* Improved performance for `impl<T> Encode for [T]`

* Added #[inline] to `impl Encoder for EncoderImpl`

---------

Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-03-30 11:45:47 +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
DavidKorczynski b1bbcd0ea4 Add CIFuzz GitHub Action (#604)
* Add CIFuzz GitHub Action

* Convert yaml to json
2022-11-25 09:44:19 +01:00
Trangar 55d66480f5 Fixed new clippy lint in rust 1.65.0 (#603) 2022-11-22 16:25:18 +01:00
odysa cbf4d46073 feat: add DecodeError::Other (#602) 2022-11-21 13:33:52 +01:00
trevyn cb46ce13b4 Move generated files to `target/generated/bincode` (#600) 2022-11-03 09:13:09 +01:00
Lena Hellström 68ae855052 Create CODE_OF_CONDUCT.md (#597) 2022-10-20 18:45:34 +02:00
trevyn 966c45544f Encode variant index instead of variant value (#593) 2022-10-18 11:56:53 +02:00
trevyn 620078dc8b Bump `virtue` to 0.0.9 and add test for #537 (#591) 2022-10-08 14:31:40 +02:00
Trangar 00c5cb0ff0 Release 2.0.0-rc.2 (#588) 2022-10-04 13:27:43 +02:00
Trangar b2977bd3ed Added `[serde(tag)]` to the list of tags that are known to give issues (#584)
* Added `[serde(tag)]` to the list of tags that are known to give issues

* Removed the old warning about serde and no-std. Added references to the documentation in the serde::DecodeError enum
2022-10-04 11:42:26 +02:00
Gino Valente c179d2de69 Allow decode with custom DeserializeSeed (#586) 2022-10-02 11:35:16 +02:00
Vincent Rouillé 1b5eab9fcf Extended BorrowDecode for HashMap to support custom hashers (#585) 2022-10-02 10:12:14 +02:00
trevyn 6d995a74c7 Document configuration generics (#581)
Co-authored-by: Trangar <gpg@trangar.com>
2022-09-28 08:00:40 +00:00
Gerd Zellweger 954abe415e Implement Encode for tuples with up-to 16 elements. (#583)
This makes it match the implementation for Decode which is
already supports up to 16 fields.

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
2022-09-28 09:42:04 +02:00
trevyn cafb13eb95 Clarify config::legacy() doc to match config::standard() (#580) 2022-09-17 17:22:31 +02:00
Gimgim ac44658bfb Document what the usizes are for (#546) (#577)
* Document what the usize is for

* Document the usize

Co-authored-by: Trangar <gpg@trangar.com>
2022-08-18 17:47:19 +00:00
Trangar c763e2f11e Implement Default for Configuration (#575) 2022-08-18 17:14:07 +00:00
Trangar e3f7d5340e Prefixed the E and D generic argument in bincode-derive (#573) 2022-08-18 19:01:30 +02:00
Trangar 88ab23f544 Made `peek_read` take `&mut self` (#572) 2022-08-18 16:54:21 +02:00
Trangar 922aba4b7a Updated test dependencies: uuid and glam (#576) 2022-08-18 16:23:56 +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
Sabrina Jewson 035baf735f Implement `Decode` for `Box<str>` (#562) 2022-07-23 11:56:42 +02:00
Trangar 21561c3eb8 Added windows and macos runner (#554)
* Added windows and macos runner

* Made the bash script use bash on windows
2022-06-15 22:26:20 +02:00
Maciej Hirsz bd07adea66 Shrink `DecodeError` from 48 to 32 bytes on 64-bit arch (#553)
* Shrink `DecodeError` to 32 bytes on 64-bit arch

* Nul with a single l

* fmt

* Consider feature combinations for error sizes

* Remove superfluous `any`

* fmt

* Box SystemTime in EncodeError
2022-06-15 20:50:09 +02:00
Maciej Hirsz 229b597a84 Add impls for Rc<[T]> and Arc<[T]> (#552) 2022-06-15 07:47:26 +02:00
Lúcás Meier 357d7d3c0e Add impl Encode for [T], where T: Encode (#542)
* Add impl Encode for [T], where T: Encode

Since Encode takes a reference, this allows us to encode &[T] directly
using this implementation. The encoding scheme is the same as for
Vec<T>.

This also makes the implementation for &[u8] superfluous, since we get
an implementation for [u8] by virtue of u8 implementing encode. This
also gives us free implementations for &[u16], &[u32], etc. which is
quite useful. Nonetheless, we keep the implementation for &[u8] around,
because the implementation can directly write a large number of bytes,
which can be more efficient than the generic implementation.

* Remove redundant Encode implementations

Since we've implemented Encode for [T], this makes the implementation
for Box<[T]> redundant (since we have a blanket implementation for
Box<T>), and ditto for &[T], which this change replaces by combining the
implementations for [T] and &T.

* Reinclude comment about Encode specialization for &[u8]
2022-06-05 18:41:43 +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 8bfa9a376f Fix cross platform tests (#540)
* Fixed cross platform targets

* Uncommented not working archs, with a reason why they fail

* Removed duplicate windows test

* Commented the other sun system

* Commented out i686-pc-windows-gnu

Co-authored-by: Victor Koenders <git@github.com>
2022-05-21 14:04:29 +02:00
Sean Cross d7edfaa0b7 Fix riscv32 atomics and fix tests on 32-bit platforms (#533)
* tests: fix alloc range test on 32-bit Windows

This test checks the range, which is necessarily different when running
on another platform.

Signed-off-by: Sean Cross <sean@xobs.io>

* enc: case usize/isize as u64/i64 in serialization

The deserialization process assumes that usize/isize are 64-bits, as
does the spec at
https://github.com/bincode-org/bincode/blob/trunk/docs/spec.md#varintencoding

Force `usize` and `isize` to be encoded as `u64` and `i64` to force
32-bit platforms to conform to this spec.

This fixes running tests under `cargo test --target i686-pc-windows-msvc`

Signed-off-by: Sean Cross <sean@xobs.io>

* atomic: only provide Atomic*64 on supported platforms

Not all platforms support AtomicI64 or AtomicU64. Use the
`target_has_atomic` config flag to determine whether to include these.

This fixes #532.

Signed-off-by: Sean Cross <sean@xobs.io>

* atomic: remove feature and use new attributes

Now that there is an attribute to indicate which atomic features are
supported on this platform, remove the `atomic` Feature and use these
new attributes.

Signed-off-by: Sean Cross <sean@xobs.io>

* alloc: run `cargo fmt`

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-08 11:35:13 +02:00
Trangar 883278fa0c Added cross platform tests workflow (#534)
* Added cross platform tests

* Added all cross platforms

* Fixed an issue where `usize` and `isize` would be encoded wrong on 32 bit platforms

* Made the cross platform tests actually run on the platforms

* Disabled cross targets that don't build right now

* Fixed a failing test on 32 bit platforms, re-enabled all platforms for testing

* Disabled failing platforms
2022-04-04 14:09:42 +02:00