From 2d70595838dc6769edd2f3a09b2dc43da08cd3c8 Mon Sep 17 00:00:00 2001 From: Daniel Lehmann Date: Fri, 13 Dec 2024 13:15:28 -0800 Subject: [PATCH] Bump version number, update changelog --- .DS_Store | Bin 0 -> 8196 bytes bitbybit-tests/.DS_Store | Bin 0 -> 6148 bytes bitbybit-tests/Cargo.toml | 2 +- bitbybit/.DS_Store | Bin 0 -> 6148 bytes bitbybit/CHANGELOG.md | 7 +++++++ bitbybit/Cargo.toml | 4 ++-- bitbybit/README.md | 13 +++++++++---- bitbybit/src/.DS_Store | Bin 0 -> 6148 bytes 8 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 .DS_Store create mode 100644 bitbybit-tests/.DS_Store create mode 100644 bitbybit/.DS_Store create mode 100644 bitbybit/src/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e08b836fa9da6d2899add8359b483f1586ab3225 GIT binary patch literal 8196 zcmeHMy^hmB5T3o{&WTPz5em}jDoZC2MS$dp?i3+J2%&%yBPaj``|L|B96O2=A}-1) z4*>4~qJ#oEL<0o~(NWRRz#||kI%a>8c=HEUKw?+g`PMr#p4o35?~M-tNV#L@0X6_2 zft_M{9mR}B^|Vj56*04kNYEd=THe?T8qFz7HK7<#3@8Q^1BwB~z`w!(p4qe|=A8Rn ztE6H;G4Nk9K;I8Kc8Vo|1CH#~fr6C)h;f`|4aaFZK-2}61P(Z&1{>k7h}@Nk5`%De zoY#e2N#KAZcLySh4A95Cfva#@TL(MIz~UD<#8@;l=~vKZ$u+d_`dKA9xI zqPu|d0Ut?O5c2@Dn6ioH@>3h_%M815MvLsEyvPd-2}dULf>W5K10l-L>V{46T)eiL zo*TAvxzA)J7GGV{w4}DK-7)Gx*JzvVPFOZux9HXNAn>f=*tBlAPPdxQTnhZQ>H1EK zIk>iiCbw_8z8!SSLC3d4=4)_8GMPwL)0@3szOa+a>iO;6v;C~zD{kXOVW-gVClklE z&YZhez2`Oj;2~WG9tz^{fE2$T$wxR^xJr2^yyw5OkM7E0`uNpvuh%nprm48Sq#K@pbc98U!MQ{e_83MIEn$qz+Yg1#4ARnjDd%L9!=&zYi%9- uUF@_`y8%b$f`XOfh^!n(9R0%($2yu)pOU}j0}7L8y~_u z--+5vVMGY-r1Nv0?|jOOWyeJ1hF6mTQJ;u1IAdoY%?{&n_Lg;&;XKE449ammTeRYg z_`M47x9if1mNc%W$@e?hj?C(!7*+KMO!oG0_kMf!bR3UPz8PIy#Qg%h5B}jq+#pw)XCbwEjKP z_ZpWgHiD8)E>y-mTG{Ch#f9qNeF!I)3tDRmm;$K+U3u*D`G5NL{Xb2zCsV)__)`kF zUQrf9ypo=+t(W7o*2B-?Y#i4Jex{%kj$*{}QG5sw2HtZAm@77dU|{wm5M;2%6!=jE FJ^(-0O_cxu literal 0 HcmV?d00001 diff --git a/bitbybit-tests/Cargo.toml b/bitbybit-tests/Cargo.toml index d68ac70..7efe605 100644 --- a/bitbybit-tests/Cargo.toml +++ b/bitbybit-tests/Cargo.toml @@ -9,7 +9,7 @@ publish = false [dependencies] bitbybit = { path = "../bitbybit" } -arbitrary-int = "1.2.7" +arbitrary-int = "1.3.0" [features] # This is to allow cfg for enum members diff --git a/bitbybit/.DS_Store b/bitbybit/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5172429f264de2441865cb4700216d4256da9242 GIT binary patch literal 6148 zcmeH~J!%6%427R!7lt%jx}3%b$PET#pTHLgIFQEJ;E>dF^gR7ES*H$5cmnB-G%I%Z zD|S`@Z2$T80!#olbXV*=%*>dt@PRwdU#I)^a=X5>;#J@&VrHyNnC;iLL0pQvfVyTmjO&;ssLc!1UOG})p;=82 zR;?Ceh}WZ?+UmMqI#RP8R>OzYoz15hnq@nzF`-!xQ4j$Um=RcIKKc27r2jVm&svm< zfC&6E0=7P!4tu^-ovjbA=k?dB`g+i*aXG_}p8zI)6mRKa+;6_1_R^8c3Qa!(fk8n8 H{*=HsM+*^= literal 0 HcmV?d00001 diff --git a/bitbybit/CHANGELOG.md b/bitbybit/CHANGELOG.md index 0a53f3b..a2016ab 100644 --- a/bitbybit/CHANGELOG.md +++ b/bitbybit/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## bitbybit 1.3.3 + +### Fixed + +- `with_` methods in the builder now produce `///` documentation. +- Bump to arbitrary_int 1.3.0 + ## bitbybit 1.3.2 ### Fixed diff --git a/bitbybit/Cargo.toml b/bitbybit/Cargo.toml index 3c54caf..b7bc908 100644 --- a/bitbybit/Cargo.toml +++ b/bitbybit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bitbybit" -version = "1.3.2" +version = "1.3.3" authors = ["Daniel Lehmann "] edition = "2021" description = "Efficient implementation of bit-fields where several numbers are packed within a larger number and bit-enums. Useful for drivers, so it works in no_std environments" @@ -19,4 +19,4 @@ proc-macro = true syn = { version = "2.0", features = ["full"] } quote = "1.0" proc-macro2 = "1.0" -arbitrary-int = "1.2.7" +arbitrary-int = "1.3.0" diff --git a/bitbybit/README.md b/bitbybit/README.md index ba8c945..d24c6bb 100644 --- a/bitbybit/README.md +++ b/bitbybit/README.md @@ -39,7 +39,8 @@ How this works: - #[bitfield(u32)] specifies that this is a bitfield in which u32 is the underlying data type. This means that all the bits inside of the bitfield - have to fit within 32 bits. Built-in Rust types (u8, u16, u32, u64, u128) as well as arbitrary-ints (u17, u48 etc) are supported. + have to fit within 32 bits. Built-in Rust types (u8, u16, u32, u64, u128) as well as arbitrary-ints (u17, u48 etc) are + supported. - Each field is annotated with the range of bits that are used by the field. The data type must match the number of bits: A range of 0..=8 with u8 would cause a compile error, as u9 is the data type that matches 0..=8. - Single bit fields are declared as "bit", all other fields as "bits" @@ -153,6 +154,7 @@ Default values are used as-is, even if they affect bits that aren't defined with ## Setting all fields at once using the builder syntax It is possible to set all fields at once, like this: + ```rs const T: Test = Test::builder() .with_baudrate(0x12) @@ -161,11 +163,14 @@ const T: Test = Test::builder() .build(); ``` -Using `builder()` it is impossible to forget setting any fields. This is checked at compile time: If any field is not set, `build()` can not be called. +Using `builder()` it is impossible to forget setting any fields. This is checked at compile time: If any field is not +set, `build()` can not be called. -At the moment, it is required to set all fields in the same order as they are specified. As Rust's const generics become more powerful, this restriction might be lifted. +At the moment, it is required to set all fields in the same order as they are specified. As Rust's const generics become +more powerful, this restriction might be lifted. For the `builder()` to be available, the following has to be true: + - The bitfield has to be completely filled with writable fields (no gaps) OR there has to be a default value specified, - No writable fields overlap. @@ -187,7 +192,7 @@ immediates in a way that they have to be reassembled. This can be achieved like Arbitrary bit widths like u5 or u67 do not exist in Rust at the moment. Therefore, the following dependency is required: ```toml -arbitrary-int = "1.2.7" +arbitrary-int = "1.3.0" ``` ## Usage diff --git a/bitbybit/src/.DS_Store b/bitbybit/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..483cd431f9766350f1ae314caba3f8f67507f722 GIT binary patch literal 6148 zcmeHK%}T>S5T0$TO%S06g@Ts_PeQ@^Lsh)Qw!VN7J*d>iR2xjQrA_Uj6mr%V>d}j@ z;1l>D&i+)CRPdsx%)sooJ3qVGFJU(W0IWLjHvkF%V4+IP*x1Yv>6e<4jIqokGBrm4 zEeOH)hW&0Tnhd{@0r~DM@F0K~uCaZ4e_kj&^i8~O81&n=T!$x7LCZf0*M6I4m2>cd?oSz1fFNReyi2T0Fb+yB` zExS=Djz*h%l@j0D*&UboXm7Jz;@g$&@z}POSJ(HC8n4Br-RvX{+Hsq?e}Xw;#BG9x^sI`D54wmP4^?? zNQePqfEf5L2FzJwEqvDkG%qng4E$LJxruWOCK`1*FjIUmvobRk3RA1&{9J_tb2L&*3=jh!8OZ8k zLEis|pV$8%lW0T?5Ci{;0hX(~^(t=3+^wn2$-9=LUZP5oaf!ya6zr(07-QvCTtroZ Zb}l=Jj=@ADT2SamK+!-AG4P`dyaK!5Z>azP literal 0 HcmV?d00001