No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
| 49 | 49 | (Unlimited, Little) => { |
|
| 50 | 50 | let $opts = DefaultOptions::new() |
|
| 51 | 51 | .with_fixint_encoding() |
|
| 52 | + | .allow_trailing_bytes() |
|
| 52 | 53 | .with_no_limit() |
|
| 53 | 54 | .with_little_endian(); |
|
| 54 | 55 | $call |
|
| 55 | 56 | } |
|
| 56 | 57 | (Unlimited, Big) => { |
|
| 57 | 58 | let $opts = DefaultOptions::new() |
|
| 58 | 59 | .with_fixint_encoding() |
|
| 60 | + | .allow_trailing_bytes() |
|
| 59 | 61 | .with_no_limit() |
|
| 60 | 62 | .with_big_endian(); |
|
| 61 | 63 | $call |
|
| 62 | 64 | } |
|
| 63 | 65 | (Unlimited, Native) => { |
|
| 64 | 66 | let $opts = DefaultOptions::new() |
|
| 65 | 67 | .with_fixint_encoding() |
|
| 68 | + | .allow_trailing_bytes() |
|
| 66 | 69 | .with_no_limit() |
|
| 67 | 70 | .with_native_endian(); |
|
| 68 | 71 | $call |
| 71 | 74 | (Limited(l), Little) => { |
|
| 72 | 75 | let $opts = DefaultOptions::new() |
|
| 73 | 76 | .with_fixint_encoding() |
|
| 77 | + | .allow_trailing_bytes() |
|
| 74 | 78 | .with_limit(l) |
|
| 75 | 79 | .with_little_endian(); |
|
| 76 | 80 | $call |
|
| 77 | 81 | } |
|
| 78 | 82 | (Limited(l), Big) => { |
|
| 79 | 83 | let $opts = DefaultOptions::new() |
|
| 80 | 84 | .with_fixint_encoding() |
|
| 85 | + | .allow_trailing_bytes() |
|
| 81 | 86 | .with_limit(l) |
|
| 82 | 87 | .with_big_endian(); |
|
| 83 | 88 | $call |
|
| 84 | 89 | } |
|
| 85 | 90 | (Limited(l), Native) => { |
|
| 86 | 91 | let $opts = DefaultOptions::new() |
|
| 87 | 92 | .with_fixint_encoding() |
|
| 93 | + | .allow_trailing_bytes() |
|
| 88 | 94 | .with_limit(l) |
|
| 89 | 95 | .with_native_endian(); |
|
| 90 | 96 | $call |
| 2 | 2 | use std::io::{Read, Write}; |
|
| 3 | 3 | use std::marker::PhantomData; |
|
| 4 | 4 | ||
| 5 | - | use config::{Infinite, InternalOptions, Options, SizeLimit}; |
|
| 5 | + | use config::{Infinite, InternalOptions, Options, SizeLimit, TrailingBytes}; |
|
| 6 | 6 | use de::read::BincodeRead; |
|
| 7 | 7 | use Result; |
|
| 8 | 8 |
| 111 | 111 | T: serde::de::DeserializeSeed<'a>, |
|
| 112 | 112 | O: InternalOptions, |
|
| 113 | 113 | { |
|
| 114 | - | let reader = ::de::read::SliceReader::new(bytes); |
|
| 115 | 114 | let options = ::config::WithOtherLimit::new(options, Infinite); |
|
| 116 | - | deserialize_from_custom_seed(seed, reader, options) |
|
| 115 | + | ||
| 116 | + | let reader = ::de::read::SliceReader::new(bytes); |
|
| 117 | + | let mut deserializer = ::de::Deserializer::with_bincode_read(reader, options); |
|
| 118 | + | let val = seed.deserialize(&mut deserializer)?; |
|
| 119 | + | ||
| 120 | + | match O::Trailing::check_end(&deserializer.reader) { |
|
| 121 | + | Ok(_) => Ok(val), |
|
| 122 | + | Err(err) => Err(err), |
|
| 123 | + | } |
|
| 117 | 124 | } |
| 94 | 94 | { |
|
| 95 | 95 | DefaultOptions::new() |
|
| 96 | 96 | .with_fixint_encoding() |
|
| 97 | + | .allow_trailing_bytes() |
|
| 97 | 98 | .serialize(value) |
|
| 98 | 99 | } |
|
| 99 | 100 |
| 107 | 108 | { |
|
| 108 | 109 | DefaultOptions::new() |
|
| 109 | 110 | .with_fixint_encoding() |
|
| 111 | + | .allow_trailing_bytes() |
|
| 110 | 112 | .deserialize_from(reader) |
|
| 111 | 113 | } |
|
| 112 | 114 |
| 122 | 124 | { |
|
| 123 | 125 | DefaultOptions::new() |
|
| 124 | 126 | .with_fixint_encoding() |
|
| 127 | + | .allow_trailing_bytes() |
|
| 125 | 128 | .deserialize_from_custom(reader) |
|
| 126 | 129 | } |
|
| 127 | 130 |
| 136 | 139 | { |
|
| 137 | 140 | DefaultOptions::new() |
|
| 138 | 141 | .with_fixint_encoding() |
|
| 142 | + | .allow_trailing_bytes() |
|
| 139 | 143 | .deserialize_in_place(reader, place) |
|
| 140 | 144 | } |
|
| 141 | 145 |
| 146 | 150 | { |
|
| 147 | 151 | DefaultOptions::new() |
|
| 148 | 152 | .with_fixint_encoding() |
|
| 153 | + | .allow_trailing_bytes() |
|
| 149 | 154 | .deserialize(bytes) |
|
| 150 | 155 | } |
|
| 151 | 156 |
| 156 | 161 | { |
|
| 157 | 162 | DefaultOptions::new() |
|
| 158 | 163 | .with_fixint_encoding() |
|
| 164 | + | .allow_trailing_bytes() |
|
| 159 | 165 | .serialized_size(value) |
|
| 160 | 166 | } |
Learn more Showing 1 files with coverage changes found.
src/config/trailing.rs
| Files | Coverage |
|---|---|
| src | 0.09% 61.43% |
| Project Totals (11 files) | 61.43% |
7188d6b67e10acab57835131b2b2