mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-03 16:44:06 +02:00
prepare for 0.11
This commit is contained in:
parent
dd1f0f0808
commit
417e8c2b96
4 changed files with 74 additions and 92 deletions
136
Cargo.lock
generated
136
Cargo.lock
generated
|
|
@ -10,10 +10,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
|||
|
||||
[[package]]
|
||||
name = "bitbuffer"
|
||||
version = "0.10.9"
|
||||
version = "0.11.0"
|
||||
dependencies = [
|
||||
"bitbuffer_derive",
|
||||
"err-derive",
|
||||
"iai",
|
||||
"maplit",
|
||||
"memchr",
|
||||
|
|
@ -21,18 +20,19 @@ dependencies = [
|
|||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitbuffer_derive"
|
||||
version = "0.10.1"
|
||||
version = "0.11.0"
|
||||
dependencies = [
|
||||
"bitbuffer",
|
||||
"merge",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"structmeta",
|
||||
"syn 2.0.22",
|
||||
"syn 2.0.38",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -41,20 +41,6 @@ version = "1.0.5"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28"
|
||||
|
||||
[[package]]
|
||||
name = "err-derive"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c34a887c8df3ed90498c1c437ce21f211c8e27672921a8ffa293cb8d6d4caa9e"
|
||||
dependencies = [
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn 1.0.92",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iai"
|
||||
version = "0.1.1"
|
||||
|
|
@ -75,9 +61,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
|
|||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.5.0"
|
||||
version = "2.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
||||
|
||||
[[package]]
|
||||
name = "merge"
|
||||
|
|
@ -98,14 +84,14 @@ dependencies = [
|
|||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.92",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.14"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
|
||||
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
|
@ -119,7 +105,7 @@ dependencies = [
|
|||
"proc-macro-error-attr",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.92",
|
||||
"syn 1.0.109",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
|
|
@ -136,28 +122,22 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.63"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb"
|
||||
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.29"
|
||||
version = "1.0.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105"
|
||||
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.9"
|
||||
|
|
@ -166,9 +146,9 @@ checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
|
|||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "0.8.8"
|
||||
version = "0.8.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c6b5a3c80cea1ab61f4260238409510e814e38b4b563c06044edf91e7dc070e3"
|
||||
checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c"
|
||||
dependencies = [
|
||||
"dyn-clone",
|
||||
"schemars_derive",
|
||||
|
|
@ -178,52 +158,52 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "schemars_derive"
|
||||
version = "0.8.8"
|
||||
version = "0.8.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41ae4dce13e8614c46ac3c38ef1c0d668b101df6ac39817aebdaa26642ddae9b"
|
||||
checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde_derive_internals",
|
||||
"syn 1.0.92",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.137"
|
||||
version = "1.0.188"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
|
||||
checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.137"
|
||||
version = "1.0.188"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be"
|
||||
checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.92",
|
||||
"syn 2.0.38",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive_internals"
|
||||
version = "0.25.0"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6"
|
||||
checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.92",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.80"
|
||||
version = "1.0.107"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f972498cf015f7c0746cac89ebe1d6ef10c293b94175a243a2d9442c163d9944"
|
||||
checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
|
|
@ -239,7 +219,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"structmeta-derive",
|
||||
"syn 2.0.22",
|
||||
"syn 2.0.38",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -250,25 +230,14 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.22",
|
||||
"syn 2.0.38",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.92"
|
||||
version = "1.0.109"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616"
|
||||
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -276,28 +245,41 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "synstructure"
|
||||
version = "0.12.6"
|
||||
name = "syn"
|
||||
version = "2.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
|
||||
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.92",
|
||||
"unicode-xid",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.49"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.49"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.9"
|
||||
version = "1.0.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
|
|
|
|||
22
Cargo.toml
22
Cargo.toml
|
|
@ -1,25 +1,25 @@
|
|||
[package]
|
||||
name = "bitbuffer"
|
||||
version = "0.10.9"
|
||||
version = "0.11.0"
|
||||
authors = ["Robin Appelman <robin@icewind.nl>"]
|
||||
edition = "2021"
|
||||
description = "Reading bit sequences from a byte slice"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/icewind1991/bitbuffer"
|
||||
rust-version = "1.56.0"
|
||||
rust-version = "1.65.0"
|
||||
|
||||
[dependencies]
|
||||
num-traits = "0.2"
|
||||
err-derive = "0.3"
|
||||
bitbuffer_derive = { version = "0.10", path = "bitbuffer_derive" }
|
||||
memchr = "2"
|
||||
serde = { version = "1", features = ["derive"], optional = true }
|
||||
schemars = { version = "0.8", optional = true }
|
||||
num-traits = "0.2.17"
|
||||
thiserror = "1.0.49"
|
||||
bitbuffer_derive = { version = "0.11.0", path = "bitbuffer_derive" }
|
||||
memchr = "2.6.4"
|
||||
serde = { version = "1.0.188", features = ["derive"], optional = true }
|
||||
schemars = { version = "0.8.15", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
maplit = "1"
|
||||
iai = "0.1"
|
||||
serde_json = "1"
|
||||
maplit = "1.0.2"
|
||||
iai = "0.1.1"
|
||||
serde_json = "1.0.107"
|
||||
|
||||
[[bench]]
|
||||
name = "bench"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "bitbuffer_derive"
|
||||
version = "0.10.1"
|
||||
version = "0.11.0"
|
||||
authors = ["Robin Appelman <robin@icewind.nl>"]
|
||||
edition = "2018"
|
||||
description = "Reading bit sequences from a byte slice"
|
||||
|
|
@ -12,11 +12,11 @@ name = "bitbuffer_derive"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = { version = "2.0.22", features = ["extra-traits"] }
|
||||
quote = "1.0.29"
|
||||
proc-macro2 = "1.0.63"
|
||||
syn = { version = "2.0.38", features = ["extra-traits"] }
|
||||
quote = "1.0.33"
|
||||
proc-macro2 = "1.0.69"
|
||||
structmeta = "0.2.0"
|
||||
merge = "0.1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
bitbuffer = { version = "0.10", path = ".." }
|
||||
bitbuffer = { version = "0.11", path = ".." }
|
||||
|
|
|
|||
14
src/lib.rs
14
src/lib.rs
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use err_derive::Error;
|
||||
use thiserror::Error;
|
||||
|
||||
pub use bitbuffer_derive::{BitRead, BitReadSized, BitWrite, BitWriteSized};
|
||||
pub use endianness::*;
|
||||
|
|
@ -101,7 +101,7 @@ mod writestream;
|
|||
pub enum BitError {
|
||||
/// Too many bits requested to fit in the requested data type
|
||||
#[error(
|
||||
display = "Too many bits requested to fit in the requested data type, requested to read {} bits while only {} fit in the datatype",
|
||||
"Too many bits requested to fit in the requested data type, requested to read {} bits while only {} fit in the datatype",
|
||||
requested,
|
||||
max
|
||||
)]
|
||||
|
|
@ -113,7 +113,7 @@ pub enum BitError {
|
|||
},
|
||||
/// Not enough data in the buffer to read all requested bits
|
||||
#[error(
|
||||
display = "Not enough data in the buffer to read all requested bits, requested to read {} bits while only {} bits are left",
|
||||
"Not enough data in the buffer to read all requested bits, requested to read {} bits while only {} bits are left",
|
||||
requested,
|
||||
bits_left
|
||||
)]
|
||||
|
|
@ -125,7 +125,7 @@ pub enum BitError {
|
|||
},
|
||||
/// The requested position is outside the bounds of the stream or buffer
|
||||
#[error(
|
||||
display = "The requested position is outside the bounds of the stream, requested position {} while the stream or buffer is only {} bits long",
|
||||
"The requested position is outside the bounds of the stream, requested position {} while the stream or buffer is only {} bits long",
|
||||
pos,
|
||||
size
|
||||
)]
|
||||
|
|
@ -137,7 +137,7 @@ pub enum BitError {
|
|||
},
|
||||
/// Unmatched discriminant found while trying to read an enum
|
||||
#[error(
|
||||
display = "Unmatched discriminant '{}' found while trying to read enum '{}'",
|
||||
"Unmatched discriminant '{}' found while trying to read enum '{}'",
|
||||
discriminant,
|
||||
enum_name
|
||||
)]
|
||||
|
|
@ -148,11 +148,11 @@ pub enum BitError {
|
|||
enum_name: String,
|
||||
},
|
||||
/// The read slice of bytes are not valid utf8
|
||||
#[error(display = "The read slice of bytes are not valid utf8: {}", _0)]
|
||||
#[error("The read slice of bytes are not valid utf8: {}", _0)]
|
||||
Utf8Error(Utf8Error, usize),
|
||||
/// The string that was requested to be written does not fit in the specified fixed length
|
||||
#[error(
|
||||
display = "The string that was requested to be written does not fit in the specified fixed length, string is {} bytes long, while a size of {} has been specified",
|
||||
"The string that was requested to be written does not fit in the specified fixed length, string is {} bytes long, while a size of {} has been specified",
|
||||
string_length,
|
||||
requested_length
|
||||
)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue