This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Fixed bitflags invocation and added <F = ()> parsing#27
Merged
VictorKoenders merged 1 commit intotrunkfrom Aug 18, 2022
Merged
Conversation
Made virtue parse `<F = ()>` constraints Fixed clippy lints Added a test suite
Codecov Report
@@ Coverage Diff @@
## trunk #27 +/- ##
==========================================
- Coverage 39.18% 38.91% -0.28%
==========================================
Files 17 19 +2
Lines 1799 1840 +41
==========================================
+ Hits 705 716 +11
- Misses 1094 1124 +30
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Contributor
Author
|
Seems to indeed fix #55, tested with the latest bincode and this version of virtue: #[derive(bincode::Encode)]
struct DefaultGenerics<T = String> {
inner: T,
}
#[test]
fn test_default_generics() {
let generics = DefaultGenerics {
inner: String::from("Hello world"),
};
let bytes = bincode::encode_to_vec(&generics, bincode::config::legacy()).unwrap();
assert_eq!(
bytes,
&[11, 0, 0, 0, 0, 0, 0, 0, 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]
);
let generics = DefaultGenerics {
inner: 0xDEADBEEFu32,
};
let bytes =
bincode::encode_to_vec(&generics, bincode::config::legacy().with_big_endian()).unwrap();
assert_eq!(bytes, &[0xDE, 0xAD, 0xBE, 0xEF],);
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bitflagscall<F = ()>constraints (closes #25)