Conversation
|
I think the version of serde_json in Cargo.lock (and Cargo.toml) is too old. |
8e926de to
594983c
Compare
Fixed |
|
To get past CI you'll need to run 'just update-lock-files' and force push please. |
|
I had play with your tests, perhaps this is cleaner? #[cfg(test)]
mod test {
use serde_json::value::Serializer;
use super::*;
#[test]
fn serialize_lower_roundtrip() {
let bytes: [u8; 4] = [0xdeu8, 0xad, 0xbe, 0xef];
let serialized = serialize_lower(&bytes, Serializer).expect("serialize");
let deserialized: [u8; 4] = deserialize(serialized).expect("deserialize");
assert_eq!(deserialized, bytes);
}
#[test]
fn serialize_upper_roundtrip() {
let bytes: [u8; 4] = [0xdeu8, 0xad, 0xbe, 0xef];
let serialized = serialize_upper(&bytes, Serializer).expect("serialize");
let deserialized: [u8; 4] = deserialize(serialized).expect("deserialize");
assert_eq!(deserialized, bytes);
}
} |
|
And thanks for the contribution, and for finding our (my) bugs! |
594983c to
e1fa1d8
Compare
Pushed |
IMO it is cleaner for tests to return |
Sure, I'm not that bothered but for the record neither of these is done anywhere else in this codebase (or the |
|
Huh. I actually didn't notice the |
|
As for avoiding wildcards, in the specific case of But agreed in general it's better to avoid them. I'm gonna go ahead and merge this, and if we want to do some broader unit test refactoring effort, we can do that separately. |
|
I also didn't know it was allowed. Interestingly GitHub does not pick up the mention, here it is: rust-bitcoin/rust-bitcoin#4882 |
PR rust-bitcoin#188 fixes issue rust-bitcoin#189, a bug in serde deserialization. Manual backport of e1fa1d8 because it did not cherry-pick cleanly.
PR rust-bitcoin#188 fixes issue rust-bitcoin#189, a bug in serde deserialization. Manual backport of e1fa1d8 because it did not cherry-pick cleanly.
PR rust-bitcoin#188 fixes issue rust-bitcoin#189. This is a manual backport, less changes needed than the original. Just the test, the fix, and uptade the `serde_json` dev dependency. Other changes in the original patch were not needed.
PR rust-bitcoin#188 fixes issue rust-bitcoin#189, a bug in serde deserialization. Manual backport of e1fa1d8 because it did not cherry-pick cleanly. Update the `Cargo-minimal.lock` because of the dev-dep change (I think).
PR rust-bitcoin#188 fixes issue rust-bitcoin#189, a bug in serde deserialization. Manual backport of e1fa1d8 because it did not cherry-pick cleanly. Patch adds a dev dependency that causes the MSRV build to choke. Update the `Cargo-minimal.lock` by using `-Z minimal-versions`.
PR rust-bitcoin#188 fixes issue rust-bitcoin#189, a bug in serde deserialization. Manual backport of e1fa1d8 because it did not cherry-pick cleanly. Patch adds a dev dependency that causes the MSRV build to choke. Update the `Cargo-minimal.lock` by using `-Z minimal-versions`.
PR rust-bitcoin#188 fixes issue rust-bitcoin#189, a bug in serde deserialization. Manual backport of e1fa1d8 because it did not cherry-pick cleanly. Patch adds a dev dependency that causes the MSRV build to choke. Update the `Cargo-minimal.lock` by using `-Z minimal-versions`. And then pin `proc-macro2` back to what it was with: `cargo update -p proc-macro2 --precise 1.0.63`
14b4bab Remove incorrect write_err import (Tobin C. Harding) e84b76c Backport 188 serde deserialization bug (Tobin C. Harding) Pull request description: PR #188 fixes issue #189. This is a manual backport, less changes needed than the original. Just the test, the fix, and uptade the `serde_json` dev dependency. Other changes in the original patch were not needed. Requires fix to pinning in CI (which uses the very old ci script on this branch). Whinge, whinge, whinge. ACKs for top commit: apoelstra: ACK 14b4bab; successfully ran local tests Tree-SHA512: 01ed03e1cb25594a49adbc46ade9e3307b94241b0ab20e41522745cb6ad23498b84f2a1626271401db393de21d2d33f9619a52e240f1550eda093402fb2e407f
903730c Backport 188 serde deserialization bug (Tobin C. Harding) Pull request description: PR #188 fixes issue #189, a bug in serde deserialization. Manual backport of e1fa1d8 because it did not cherry-pick cleanly. Patch adds a dev dependency that causes the MSRV build to choke. Update the `Cargo-minimal.lock` by using `-Z minimal-versions`. And then pin `proc-macro2` back to what it was with: `cargo update -p proc-macro2 --precise 1.0.63` ACKs for top commit: apoelstra: ACK 903730c; successfully ran local tests Tree-SHA512: 0f9d0f45ecb3e559c0821462a6e239680241ef9a653c79cd5a7806299351f2643162d53f93e0c5c651985a465b868074fdb85bf3b64d2799aafaf98b0c69570a
Fixes #189.
The changes in src/display.rs and src/iter.rs were necessary, since using
serde_jsonin tests brings animpl PartialEq<serde_json::Value> for usizeinto context, which makes some code in the aforementioned tests ambiguous without explicitly specifying types