From 6442f10315d2869d88f9aafa980965f0edad7bac Mon Sep 17 00:00:00 2001 From: kl-botsu Date: Thu, 24 Aug 2023 15:13:21 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20khonsula?= =?UTF-8?q?bs/pot@c9fb4bdabfb75e60e07edc87c4b3b44987ddb3e6=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coverage/badge.svg | 4 +- .../benchmarks/benches/benchmarks.rs.html | 16 +- coverage/benchmarks/benches/index.html | 2 +- coverage/benchmarks/examples/index.html | 2 +- coverage/benchmarks/examples/logs.rs.html | 16 +- coverage/index.html | 18 +- coverage/pot/examples/index.html | 2 +- .../pot/examples/preshared-symbols.rs.html | 2 +- coverage/pot/examples/simple.rs.html | 2 +- coverage/pot/src/de.rs.html | 168 ++++---- coverage/pot/src/error.rs.html | 2 +- coverage/pot/src/format.rs.html | 314 +++++++-------- coverage/pot/src/index.html | 22 +- coverage/pot/src/lib.rs.html | 358 ++++++++++++++++-- coverage/pot/src/reader.rs.html | 48 +-- coverage/pot/src/ser.rs.html | 14 +- coverage/pot/src/value.rs.html | 2 +- 17 files changed, 652 insertions(+), 340 deletions(-) diff --git a/coverage/badge.svg b/coverage/badge.svg index 33ec0814..fd6d4da1 100644 --- a/coverage/badge.svg +++ b/coverage/badge.svg @@ -17,7 +17,7 @@ coverage coverage - 87.71% - 87.71% + 87.78% + 87.78% \ No newline at end of file diff --git a/coverage/benchmarks/benches/benchmarks.rs.html b/coverage/benchmarks/benches/benchmarks.rs.html index 9a9accb8..8cfdbaf4 100644 --- a/coverage/benchmarks/benches/benchmarks.rs.html +++ b/coverage/benchmarks/benches/benchmarks.rs.html @@ -720,7 +720,7 @@
- 5033 + 4959
                Some(Sentence(3..100).fake_with_rng(rand))
@@ -746,7 +746,7 @@
- 4967 + 5041
                None
@@ -863,7 +863,7 @@
- 2023 + 1947
            0 => Level::Trace,
@@ -876,7 +876,7 @@
- 2046 + 2067
            1 => Level::Debug,
@@ -889,7 +889,7 @@
- 2047 + 2044
            2 => Level::Info,
@@ -902,7 +902,7 @@
- 1954 + 1980
            3 => Level::Warn,
@@ -915,7 +915,7 @@
- 1930 + 1962
            4 => Level::Error,
@@ -3133,7 +3133,7 @@
diff --git a/coverage/benchmarks/benches/index.html b/coverage/benchmarks/benches/index.html index daa66936..b3af641f 100644 --- a/coverage/benchmarks/benches/index.html +++ b/coverage/benchmarks/benches/index.html @@ -74,7 +74,7 @@ diff --git a/coverage/benchmarks/examples/index.html b/coverage/benchmarks/examples/index.html index 98019a2c..b3e47fc1 100644 --- a/coverage/benchmarks/examples/index.html +++ b/coverage/benchmarks/examples/index.html @@ -74,7 +74,7 @@ diff --git a/coverage/benchmarks/examples/logs.rs.html b/coverage/benchmarks/examples/logs.rs.html index 3c4c55ce..09232880 100644 --- a/coverage/benchmarks/examples/logs.rs.html +++ b/coverage/benchmarks/examples/logs.rs.html @@ -1916,7 +1916,7 @@
- 54942 + 54887
                Some(Sentence(3..100).fake_with_rng(rand))
@@ -1942,7 +1942,7 @@
- 55059 + 55114
                None
@@ -2059,7 +2059,7 @@
- 21977 + 22006
            0 => Level::Trace,
@@ -2072,7 +2072,7 @@
- 22000 + 21993
            1 => Level::Debug,
@@ -2085,7 +2085,7 @@
- 21934 + 21809
            2 => Level::Info,
@@ -2098,7 +2098,7 @@
- 21934 + 22171
            3 => Level::Warn,
@@ -2111,7 +2111,7 @@
- 22156 + 22022
            4 => Level::Error,
@@ -3185,7 +3185,7 @@
diff --git a/coverage/index.html b/coverage/index.html index 9d9983a9..bfc5bd4c 100644 --- a/coverage/index.html +++ b/coverage/index.html @@ -15,7 +15,7 @@

Lines

- 87.71 %

+ 87.78 %

@@ -23,7 +23,7 @@

Functions

- 61.54 %

+ 61.53 %

@@ -124,20 +124,20 @@ - 86.97% + 87.04% - 86.97% + 87.04% - 3625 / 4168 + 3648 / 4191 - 61.33% - 1646 / 2684 + 61.31% + 1661 / 2709 100 0 / 0 @@ -146,7 +146,7 @@ diff --git a/coverage/pot/examples/index.html b/coverage/pot/examples/index.html index 2efe4eb0..6929176f 100644 --- a/coverage/pot/examples/index.html +++ b/coverage/pot/examples/index.html @@ -98,7 +98,7 @@ diff --git a/coverage/pot/examples/preshared-symbols.rs.html b/coverage/pot/examples/preshared-symbols.rs.html index 66d1fbe9..9389a1e7 100644 --- a/coverage/pot/examples/preshared-symbols.rs.html +++ b/coverage/pot/examples/preshared-symbols.rs.html @@ -780,7 +780,7 @@ diff --git a/coverage/pot/examples/simple.rs.html b/coverage/pot/examples/simple.rs.html index 44438b7b..ac7e3406 100644 --- a/coverage/pot/examples/simple.rs.html +++ b/coverage/pot/examples/simple.rs.html @@ -455,7 +455,7 @@ diff --git a/coverage/pot/src/de.rs.html b/coverage/pot/src/de.rs.html index bcf0f18f..aabecf78 100644 --- a/coverage/pot/src/de.rs.html +++ b/coverage/pot/src/de.rs.html @@ -23,7 +23,7 @@

Functions

- 60.03 %

+ 60.06 %

@@ -629,7 +629,7 @@
- 135 + 136
    pub(crate) fn from_slice(input: &'de [u8], maximum_bytes_allocatable: usize) -> Result<Self> {
@@ -642,7 +642,7 @@
- 135 + 136
        Self::from_slice_with_symbols(input, SymbolMapRef::temporary(), maximum_bytes_allocatable)
@@ -655,7 +655,7 @@
- 135 + 136
    }
@@ -681,7 +681,7 @@
- 167 + 168
    fn from_slice_with_symbols(
@@ -694,7 +694,7 @@
- 167 + 168
        input: &'de [u8],
@@ -707,7 +707,7 @@
- 167 + 168
        symbols: SymbolMapRef<'s, 'de>,
@@ -720,7 +720,7 @@
- 167 + 168
        maximum_bytes_allocatable: usize,
@@ -733,7 +733,7 @@
- 167 + 168
    ) -> Result<Self> {
@@ -746,7 +746,7 @@
- 167 + 168
        Self::new(SliceReader::from(input), symbols, maximum_bytes_allocatable)
@@ -759,7 +759,7 @@
- 167 + 168
    }
@@ -824,7 +824,7 @@
- 122 + 123
    pub fn end_of_input(&self) -> bool {
@@ -837,7 +837,7 @@
- 122 + 123
        self.input.data.is_empty() && self.peeked_atom.is_empty()
@@ -850,7 +850,7 @@
- 122 + 123
    }
@@ -1071,7 +1071,7 @@
- 227 + 228
    pub(crate) fn new(
@@ -1084,7 +1084,7 @@
- 227 + 228
        input: R,
@@ -1097,7 +1097,7 @@
- 227 + 228
        symbols: SymbolMapRef<'s, 'de>,
@@ -1110,7 +1110,7 @@
- 227 + 228
        maximum_bytes_allocatable: usize,
@@ -1123,7 +1123,7 @@
- 227 + 228
    ) -> Result<Self> {
@@ -1136,7 +1136,7 @@
- 227 + 228
        let mut deserializer = Deserializer {
@@ -1149,7 +1149,7 @@
- 227 + 228
            input,
@@ -1162,7 +1162,7 @@
- 227 + 228
            symbols,
@@ -1175,7 +1175,7 @@
- 227 + 228
            peeked_atom: VecDeque::new(),
@@ -1188,7 +1188,7 @@
- 227 + 228
            remaining_budget: maximum_bytes_allocatable,
@@ -1201,7 +1201,7 @@
- 227 + 228
            scratch: Vec::new(),
@@ -1214,7 +1214,7 @@
- 227 + 228
        };
@@ -1227,7 +1227,7 @@
- 227 + 228
        deserializer.read_header()?;
@@ -1240,7 +1240,7 @@
- 226 + 227
        Ok(deserializer)
@@ -1253,7 +1253,7 @@
- 227 + 228
    }
@@ -1279,7 +1279,7 @@
- 227 + 228
    fn read_header(&mut self) -> Result<()> {
@@ -1292,7 +1292,7 @@
- 227 + 228
        let version = format::read_header(&mut self.input)?;
@@ -1305,7 +1305,7 @@
- 227 + 228
        if version == CURRENT_VERSION {
@@ -1318,7 +1318,7 @@
- 226 + 227
            Ok(())
@@ -1370,7 +1370,7 @@
- 227 + 228
    }
@@ -1409,7 +1409,7 @@
- 170774 + 170779
        if let Some(peeked) = self.peeked_atom.pop_front() {
@@ -1448,7 +1448,7 @@
- 160754 + 160759
            format::read_atom(
@@ -1461,7 +1461,7 @@
- 160754 + 160759
                &mut self.input,
@@ -1474,7 +1474,7 @@
- 160754 + 160759
                &mut self.remaining_budget,
@@ -1487,7 +1487,7 @@
- 160754 + 160759
                &mut self.scratch,
@@ -1500,7 +1500,7 @@
- 160754 + 160759
            )
@@ -1526,7 +1526,7 @@
- 170774 + 170779
    }
@@ -1747,7 +1747,7 @@
- 160289 + 160293
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(visitor)))]
@@ -5959,7 +5959,7 @@
- 20048 + 20050
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(visitor)))]
@@ -7636,7 +7636,7 @@
- 70112 + 69962
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(visitor)))]
@@ -8052,7 +8052,7 @@
- 50100 + 49950
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(visitor)))]
@@ -10015,7 +10015,7 @@
- 20038 + 20040
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(visitor)))]
@@ -10249,7 +10249,7 @@
- 20034 + 20036
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(visitor)))]
@@ -10613,7 +10613,7 @@
- 160290 + 160294
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(visitor)))]
@@ -11588,7 +11588,7 @@
- 10052 + 10053
    fn new(de: &'a mut Deserializer<'s, 'de, R>, count: Option<usize>) -> Self {
@@ -11601,7 +11601,7 @@
- 10052 + 10053
        Self {
@@ -11614,7 +11614,7 @@
- 10052 + 10053
            de,
@@ -11627,7 +11627,7 @@
- 10052 + 10053
            count,
@@ -11640,7 +11640,7 @@
- 10052 + 10053
            consumed: 0,
@@ -11653,7 +11653,7 @@
- 10052 + 10053
            eof: false,
@@ -11666,7 +11666,7 @@
- 10052 + 10053
        }
@@ -11679,7 +11679,7 @@
- 10052 + 10053
    }
@@ -11705,7 +11705,7 @@
- 90331 + 90334
    fn check_is_eof(&mut self) -> Result<bool> {
@@ -11718,7 +11718,7 @@
- 90331 + 90334
        if self.eof {
@@ -11744,7 +11744,7 @@
- 90331 + 90334
        } else if let Some(count) = self.count {
@@ -11757,7 +11757,7 @@
- 90325 + 90328
            if count == self.consumed {
@@ -11770,7 +11770,7 @@
- 10042 + 10043
                self.eof = true;
@@ -11783,7 +11783,7 @@
- 10042 + 10043
                return Ok(true);
@@ -11796,7 +11796,7 @@
- 80283 + 80285
            }
@@ -11952,7 +11952,7 @@
- 80287 + 80289
        Ok(false)
@@ -11965,7 +11965,7 @@
- 90331 + 90334
    }
@@ -12485,7 +12485,7 @@
- 160317 + 160323
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(seed)))]
@@ -12667,7 +12667,7 @@
- 140277 + 140281
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(seed)))]
@@ -13863,7 +13863,7 @@
- 208 + 209
    pub(crate) const fn temporary() -> Self {
@@ -13876,7 +13876,7 @@
- 208 + 209
        Self(SymbolMapRefPrivate::Temporary(SymbolList::new()))
@@ -13889,7 +13889,7 @@
- 208 + 209
    }
@@ -14331,7 +14331,7 @@
- 237 + 239
    fn push_borrowed(&mut self, symbol: &'de str) {
@@ -14344,7 +14344,7 @@
- 237 + 239
        match &mut self.0 {
@@ -14357,7 +14357,7 @@
- 190 + 192
            SymbolMapRefPrivate::Temporary(vec) => vec.push_borrowed(symbol),
@@ -14396,7 +14396,7 @@
- 237 + 239
    }
@@ -14669,7 +14669,7 @@
- 214 + 215
    pub const fn new() -> Self {
@@ -14682,7 +14682,7 @@
- 214 + 215
        Self {
@@ -14695,7 +14695,7 @@
- 214 + 215
            buffer: String::new(),
@@ -14708,7 +14708,7 @@
- 214 + 215
            entries: Vec::new(),
@@ -14721,7 +14721,7 @@
- 214 + 215
        }
@@ -14734,7 +14734,7 @@
- 214 + 215
    }
@@ -14786,7 +14786,7 @@
- 190 + 192
    pub fn push_borrowed(&mut self, borrowed: &'de str) {
@@ -14799,7 +14799,7 @@
- 190 + 192
        self.entries.push(SymbolListEntry::Borrowed(borrowed));
@@ -14812,7 +14812,7 @@
- 190 + 192
    }
@@ -16783,7 +16783,7 @@
diff --git a/coverage/pot/src/error.rs.html b/coverage/pot/src/error.rs.html index 96c3d20e..9844ca21 100644 --- a/coverage/pot/src/error.rs.html +++ b/coverage/pot/src/error.rs.html @@ -1547,7 +1547,7 @@ diff --git a/coverage/pot/src/format.rs.html b/coverage/pot/src/format.rs.html index 88e29dcc..54d36e18 100644 --- a/coverage/pot/src/format.rs.html +++ b/coverage/pot/src/format.rs.html @@ -23,7 +23,7 @@

Functions

- 56.6 %

+ 56.79 %

@@ -213,7 +213,7 @@
- 1660108 + 1660721
fn write_tiny_atom_header<W: WriteBytesExt>(
@@ -226,7 +226,7 @@
- 1660108 + 1660721
    mut writer: W,
@@ -239,7 +239,7 @@
- 1660108 + 1660721
    kind: Kind,
@@ -252,7 +252,7 @@
- 1660108 + 1660721
    arg: u8,
@@ -265,7 +265,7 @@
- 1660108 + 1660721
) -> std::io::Result<usize> {
@@ -278,7 +278,7 @@
- 1660108 + 1660721
    // Kind is the 3 bits.
@@ -291,7 +291,7 @@
- 1660108 + 1660721
    let mut first_byte = (kind as u8) << 5;
@@ -304,7 +304,7 @@
- 1660108 + 1660721
    if arg > 0 {
@@ -317,7 +317,7 @@
- 1589414 + 1589691
        debug_assert!(arg < 0x10);
@@ -330,7 +330,7 @@
- 1589414 + 1589691
        first_byte |= arg & 0b1111;
@@ -343,7 +343,7 @@
- 70694 + 71030
    }
@@ -369,7 +369,7 @@
- 1660108 + 1660721
    writer.write_all(&[first_byte])?;
@@ -382,7 +382,7 @@
- 1660108 + 1660721
    Ok(1)
@@ -395,7 +395,7 @@
- 1660108 + 1660721
}
@@ -538,7 +538,7 @@
- 1379839 + 1380452
        write_tiny_atom_header(writer, kind, arg as u8)
@@ -577,7 +577,7 @@
- 583666 + 583053
        let mut first_byte = (kind as u8) << 5;
@@ -590,7 +590,7 @@
- 583666 + 583053
        // The last 4 bits are the first 4 bits of the arg. We also know
@@ -603,7 +603,7 @@
- 583666 + 583053
        // that we're longer than one byte, due to the original match.
@@ -616,7 +616,7 @@
- 583666 + 583053
        first_byte |= arg as u8 & 0b1111;
@@ -629,7 +629,7 @@
- 583666 + 583053
        arg >>= 4;
@@ -642,7 +642,7 @@
- 583666 + 583053
        first_byte |= 0b10000;
@@ -655,7 +655,7 @@
- 583666 + 583053

@@ -668,7 +668,7 @@
             
- 583666 + 583053
        let mut second = arg as u8 & 0x7F;
@@ -681,7 +681,7 @@
- 583666 + 583053
        arg >>= 7;
@@ -694,7 +694,7 @@
- 583666 + 583053
        if arg == 0 {
@@ -707,7 +707,7 @@
- 583608 + 582995
            writer.write_all(&[first_byte, second])?;
@@ -720,7 +720,7 @@
- 583608 + 582995
            return Ok(2);
@@ -1656,7 +1656,7 @@
- 160837 + 160842
pub fn read_atom_header<R: ReadBytesExt>(reader: &mut R) -> Result<(Kind, u64), Error> {
@@ -1669,7 +1669,7 @@
- 160837 + 160842
    let first_byte = reader.read_u8()?;
@@ -1682,7 +1682,7 @@
- 160837 + 160842
    let kind = Kind::from_u8(first_byte >> 5)?;
@@ -1695,7 +1695,7 @@
- 160837 + 160842
    let mut arg = u64::from(first_byte & 0b1111);
@@ -1708,7 +1708,7 @@
- 160837 + 160842
    if first_byte & 0b10000 != 0 {
@@ -1721,7 +1721,7 @@
- 42067 + 41951
        let mut bytes_remaining = 9;
@@ -1734,7 +1734,7 @@
- 42067 + 41951
        let mut offset = 4;
@@ -1760,7 +1760,7 @@
- 42304 + 42188
            let byte = reader.read_u8()?;
@@ -1773,7 +1773,7 @@
- 42304 + 42188
            let data = byte & 0x7f;
@@ -1786,7 +1786,7 @@
- 42304 + 42188
            arg |= u64::from(data) << offset;
@@ -1799,7 +1799,7 @@
- 42304 + 42188
            offset += 7;
@@ -1812,7 +1812,7 @@
- 42304 + 42188
            bytes_remaining -= 1;
@@ -1825,7 +1825,7 @@
- 42304 + 42188
            if data == byte || bytes_remaining == 0 {
@@ -1838,7 +1838,7 @@
- 42067 + 41951
                break;
@@ -1877,7 +1877,7 @@
- 118770 + 118891
    }
@@ -1903,7 +1903,7 @@
- 160837 + 160842
    Ok((kind, arg))
@@ -1916,7 +1916,7 @@
- 160837 + 160842
}
@@ -2410,7 +2410,7 @@
- 160853 + 160858
    pub const fn from_u8(kind: u8) -> Result<Self, Error> {
@@ -2423,7 +2423,7 @@
- 160853 + 160858
        match kind {
@@ -2436,7 +2436,7 @@
- 15033 + 15109
            0 => Ok(Self::Special),
@@ -2462,7 +2462,7 @@
- 20176 + 20177
            2 => Ok(Self::UInt),
@@ -2501,7 +2501,7 @@
- 10097 + 10098
            5 => Ok(Self::Map),
@@ -2514,7 +2514,7 @@
- 80253 + 80255
            6 => Ok(Self::Symbol),
@@ -2527,7 +2527,7 @@
- 35083 + 35008
            7 => Ok(Self::Bytes),
@@ -2566,7 +2566,7 @@
- 160853 + 160858
    }
@@ -2943,7 +2943,7 @@
- 15033 + 15109
    fn try_from(value: u64) -> Result<Self, Self::Error> {
@@ -2956,7 +2956,7 @@
- 15033 + 15109
        match value {
@@ -2969,7 +2969,7 @@
- 4988 + 5064
            0 => Ok(Self::None),
@@ -3086,7 +3086,7 @@
- 15033 + 15109
    }
@@ -3502,7 +3502,7 @@
- 229 + 230
pub fn read_header<R: ReadBytesExt>(reader: &mut R) -> Result<u8, Error> {
@@ -3515,7 +3515,7 @@
- 229 + 230
    let header = reader.read_u32::<BigEndian>()?;
@@ -3528,7 +3528,7 @@
- 229 + 230
    if header & 0x506F_7400 == 0x506F_7400 {
@@ -3541,7 +3541,7 @@
- 228 + 229
        let version = (header & 0xFF) as u8;
@@ -3554,7 +3554,7 @@
- 228 + 229
        Ok(version)
@@ -3606,7 +3606,7 @@
- 229 + 230
}
@@ -3645,7 +3645,7 @@
- 209996 + 210275
pub fn write_special<W: WriteBytesExt>(writer: W, special: Special) -> std::io::Result<usize> {
@@ -3658,7 +3658,7 @@
- 209996 + 210275
    write_atom_header(writer, Kind::Special, special as u64)
@@ -3671,7 +3671,7 @@
- 209996 + 210275
}
@@ -3723,7 +3723,7 @@
- 69966 + 70245
pub fn write_none<W: WriteBytesExt>(writer: W) -> std::io::Result<usize> {
@@ -3736,7 +3736,7 @@
- 69966 + 70245
    write_special(writer, Special::None)
@@ -3749,7 +3749,7 @@
- 69966 + 70245
}
@@ -5270,7 +5270,7 @@
- 660 + 717
pub fn write_u8<W: WriteBytesExt>(mut writer: W, value: u8) -> std::io::Result<usize> {
@@ -5283,7 +5283,7 @@
- 660 + 717
    let header_len = write_tiny_atom_header(&mut writer, Kind::UInt, 0)?;
@@ -5296,7 +5296,7 @@
- 660 + 717
    writer
@@ -5309,7 +5309,7 @@
- 660 + 717
        .write_u8(value)
@@ -5322,7 +5322,7 @@
- 660 + 717
        .map(|_| std::mem::size_of::<u8>() + header_len)
@@ -5335,7 +5335,7 @@
- 660 + 717
}
@@ -5413,7 +5413,7 @@
- 632 + 689
        write_u8(writer, value)
@@ -5439,7 +5439,7 @@
- 139461 + 139404
        let header_len = write_tiny_atom_header(&mut writer, Kind::UInt, 1)?;
@@ -5452,7 +5452,7 @@
- 139461 + 139404
        writer
@@ -5465,7 +5465,7 @@
- 139461 + 139404
            .write_u16::<LittleEndian>(value)
@@ -5478,7 +5478,7 @@
- 139461 + 139404
            .map(|_| std::mem::size_of::<u16>() + header_len)
@@ -5907,7 +5907,7 @@
- 65 + 66
    if let Ok(value) = u32::try_from(value) {
@@ -5946,7 +5946,7 @@
- 4 + 5
        let header_len = write_tiny_atom_header(&mut writer, Kind::UInt, 5)?;
@@ -5959,7 +5959,7 @@
- 4 + 5
        writer
@@ -5972,7 +5972,7 @@
- 4 + 5
            .write_u48::<LittleEndian>(value)
@@ -5985,7 +5985,7 @@
- 4 + 5
            .map(|_| 6 + header_len)
@@ -6011,7 +6011,7 @@
- 65 + 66
}
@@ -6089,7 +6089,7 @@
- 65 + 66
        write_u48(writer, value)
@@ -6115,7 +6115,7 @@
- 140014 + 140013
        let header_len = write_tiny_atom_header(&mut writer, Kind::UInt, 7)?;
@@ -6128,7 +6128,7 @@
- 140014 + 140013
        writer
@@ -6141,7 +6141,7 @@
- 140014 + 140013
            .write_u64::<LittleEndian>(value)
@@ -6154,7 +6154,7 @@
- 140014 + 140013
            .map(|_| std::mem::size_of::<u64>() + header_len)
@@ -6999,7 +6999,7 @@
- 490071 + 489792
pub fn write_str<W: WriteBytesExt>(writer: W, value: &str) -> std::io::Result<usize> {
@@ -7012,7 +7012,7 @@
- 490071 + 489792
    write_bytes(writer, value.as_bytes())
@@ -7025,7 +7025,7 @@
- 490071 + 489792
}
@@ -7077,7 +7077,7 @@
- 490083 + 489804
pub fn write_bytes<W: WriteBytesExt>(mut writer: W, value: &[u8]) -> std::io::Result<usize> {
@@ -7090,7 +7090,7 @@
- 490083 + 489804
    let header_len = write_atom_header(&mut writer, Kind::Bytes, value.len() as u64)?;
@@ -7103,7 +7103,7 @@
- 490083 + 489804
    writer.write_all(value)?;
@@ -7116,7 +7116,7 @@
- 490083 + 489804
    Ok(value.len() + header_len)
@@ -7129,7 +7129,7 @@
- 490083 + 489804
}
@@ -8949,7 +8949,7 @@
- 52 + 58
            InnerInteger::U8(value) => Ok(*value as u16),
@@ -8962,7 +8962,7 @@
- 9970 + 9964
            InnerInteger::U16(value) => Ok(*value),
@@ -10639,7 +10639,7 @@
- 10061 + 10062
    pub const fn as_u64(&self) -> Result<u64, Error> {
@@ -10652,7 +10652,7 @@
- 10061 + 10062
        match &self.0 {
@@ -10977,7 +10977,7 @@
- 10011 + 10012
            InnerInteger::U64(value) => Ok(*value),
@@ -11107,7 +11107,7 @@
- 10061 + 10062
    }
@@ -12017,7 +12017,7 @@
- 20313 + 20314
    pub fn read_from<R: ReadBytesExt>(
@@ -12030,7 +12030,7 @@
- 20313 + 20314
        kind: Kind,
@@ -12043,7 +12043,7 @@
- 20313 + 20314
        byte_len: usize,
@@ -12056,7 +12056,7 @@
- 20313 + 20314
        reader: &mut R,
@@ -12069,7 +12069,7 @@
- 20313 + 20314
    ) -> Result<Self, Error> {
@@ -12082,7 +12082,7 @@
- 20313 + 20314
        match kind {
@@ -12225,7 +12225,7 @@
- 20175 + 20176
            Kind::UInt => match byte_len {
@@ -12238,7 +12238,7 @@
- 156 + 162
                1 => Ok(InnerInteger::U8(reader.read_u8()?)),
@@ -12251,7 +12251,7 @@
- 9972 + 9966
                2 => Ok(InnerInteger::U16(reader.read_u16::<LittleEndian>()?)),
@@ -12303,7 +12303,7 @@
- 10015 + 10016
                8 => Ok(InnerInteger::U64(reader.read_u64::<LittleEndian>()?)),
@@ -12381,7 +12381,7 @@
- 20313 + 20314
        .map(Integer)
@@ -12394,7 +12394,7 @@
- 20313 + 20314
    }
@@ -13629,7 +13629,7 @@
- 160754 + 160759
pub fn read_atom<'de, R: Reader<'de>>(
@@ -13642,7 +13642,7 @@
- 160754 + 160759
    reader: &mut R,
@@ -13655,7 +13655,7 @@
- 160754 + 160759
    remaining_budget: &mut usize,
@@ -13668,7 +13668,7 @@
- 160754 + 160759
    scratch: &mut Vec<u8>,
@@ -13681,7 +13681,7 @@
- 160754 + 160759
) -> Result<Atom<'de>, Error> {
@@ -13694,7 +13694,7 @@
- 160754 + 160759
    let (kind, arg) = read_atom_header(reader)?;
@@ -13707,7 +13707,7 @@
- 160754 + 160759
    Ok(match kind {
@@ -13720,7 +13720,7 @@
- 90302 + 90305
        Kind::Sequence | Kind::Map | Kind::Symbol => Atom {
@@ -13733,7 +13733,7 @@
- 90302 + 90305
            kind,
@@ -13746,7 +13746,7 @@
- 90302 + 90305
            arg,
@@ -13759,7 +13759,7 @@
- 90302 + 90305
            nucleus: None,
@@ -13772,7 +13772,7 @@
- 90302 + 90305
        },
@@ -13798,7 +13798,7 @@
- 15032 + 15108
            kind,
@@ -13811,7 +13811,7 @@
- 15032 + 15108
            arg,
@@ -13824,7 +13824,7 @@
- 15032 + 15108
            nucleus: match Special::try_from(arg)? {
@@ -13837,7 +13837,7 @@
- 4988 + 5064
                Special::None => None,
@@ -13967,7 +13967,7 @@
- 20295 + 20296
            let bytes = arg as usize + 1;
@@ -13980,7 +13980,7 @@
- 20295 + 20296
            update_budget(remaining_budget, in_memory_int_size(bytes))?;
@@ -14006,7 +14006,7 @@
- 20295 + 20296
                kind,
@@ -14019,7 +14019,7 @@
- 20295 + 20296
                arg,
@@ -14032,7 +14032,7 @@
- 20295 + 20296
                nucleus: Some(Nucleus::Integer(Integer::read_from(kind, bytes, reader)?)),
@@ -14201,7 +14201,7 @@
- 35082 + 35007
            let bytes = arg as usize;
@@ -14214,7 +14214,7 @@
- 35082 + 35007
            update_budget(remaining_budget, bytes)?;
@@ -14227,7 +14227,7 @@
- 35080 + 35005
            let bytes = reader.buffered_read_bytes(bytes, scratch)?;
@@ -14240,7 +14240,7 @@
- 35079 + 35004
            Atom {
@@ -14253,7 +14253,7 @@
- 35079 + 35004
                kind,
@@ -14266,7 +14266,7 @@
- 35079 + 35004
                arg,
@@ -14279,7 +14279,7 @@
- 35079 + 35004
                nucleus: Some(Nucleus::Bytes(bytes)),
@@ -14292,7 +14292,7 @@
- 35079 + 35004
            }
@@ -14331,7 +14331,7 @@
- 160754 + 160759
}
@@ -14370,7 +14370,7 @@
- 20338 + 20339
pub(crate) const fn in_memory_int_size(encoded_length: usize) -> usize {
@@ -14383,7 +14383,7 @@
- 20338 + 20339
    // Some integers are stored more compact than we can represent them in memory
@@ -14396,7 +14396,7 @@
- 20338 + 20339
    match encoded_length {
@@ -14435,7 +14435,7 @@
- 20309 + 20310
        other => other,
@@ -14461,7 +14461,7 @@
- 20338 + 20339
}
@@ -14513,7 +14513,7 @@
- 55420 + 55346
    if let Some(remaining) = budget.checked_sub(read_amount) {
@@ -14526,7 +14526,7 @@
- 55417 + 55343
        *budget = remaining;
@@ -14539,7 +14539,7 @@
- 55417 + 55343
        Ok(())
@@ -14591,7 +14591,7 @@
- 55420 + 55346
}
@@ -23985,7 +23985,7 @@
diff --git a/coverage/pot/src/index.html b/coverage/pot/src/index.html index 8cf70d71..3e5f9942 100644 --- a/coverage/pot/src/index.html +++ b/coverage/pot/src/index.html @@ -15,7 +15,7 @@

Lines

- 86.97 %

+ 87.04 %

@@ -23,7 +23,7 @@

Functions

- 61.33 %

+ 61.31 %

@@ -64,8 +64,8 @@ 284 / 302 - 60.03% - 404 / 673 + 60.06% + 409 / 681 100 0 / 0 @@ -112,8 +112,8 @@ 1119 / 1121 - 56.6% - 300 / 530 + 56.79% + 301 / 530 100 0 / 0 @@ -124,7 +124,7 @@ 99.72% @@ -133,11 +133,11 @@ 99.72% - 702 / 704 + 725 / 727 - 83.21% - 441 / 530 + 82.27% + 450 / 547 100 0 / 0 @@ -218,7 +218,7 @@ diff --git a/coverage/pot/src/lib.rs.html b/coverage/pot/src/lib.rs.html index ae191c90..13433e43 100644 --- a/coverage/pot/src/lib.rs.html +++ b/coverage/pot/src/lib.rs.html @@ -15,7 +15,7 @@

Lines

- 99.72 %

+ 99.72 %

@@ -23,7 +23,7 @@

Functions

- 83.21 %

+ 82.27 %

@@ -1097,7 +1097,7 @@
- 129 + 130
pub fn from_slice<'a, T>(serialized: &'a [u8]) -> Result<T>
@@ -1110,7 +1110,7 @@
- 129 + 130
where
@@ -1123,7 +1123,7 @@
- 129 + 130
    T: Deserialize<'a>,
@@ -1136,7 +1136,7 @@
- 129 + 130
{
@@ -1149,7 +1149,7 @@
- 129 + 130
    Config::default().deserialize(serialized)
@@ -1162,7 +1162,7 @@
- 129 + 130
}
@@ -1526,7 +1526,7 @@
- 1346 + 1347
    fn default() -> Self {
@@ -1539,7 +1539,7 @@
- 1346 + 1347
        Self {
@@ -1552,7 +1552,7 @@
- 1346 + 1347
            allocation_budget: usize::MAX,
@@ -1565,7 +1565,7 @@
- 1346 + 1347
        }
@@ -1578,7 +1578,7 @@
- 1346 + 1347
    }
@@ -1825,7 +1825,7 @@
- 134 + 135
    pub fn deserialize<'de, T>(&self, serialized: &'de [u8]) -> Result<T>
@@ -1838,7 +1838,7 @@
- 134 + 135
    where
@@ -1851,7 +1851,7 @@
- 134 + 135
        T: Deserialize<'de>,
@@ -1864,7 +1864,7 @@
- 134 + 135
    {
@@ -1877,7 +1877,7 @@
- 134 + 135
        let mut deserializer = de::Deserializer::from_slice(serialized, self.allocation_budget)?;
@@ -1890,7 +1890,7 @@
- 133 + 134
        let t = T::deserialize(&mut deserializer)?;
@@ -1903,7 +1903,7 @@
- 122 + 123
        if deserializer.end_of_input() {
@@ -1916,7 +1916,7 @@
- 122 + 123
            Ok(t)
@@ -1968,7 +1968,7 @@
- 134 + 135
    }
@@ -12473,6 +12473,318 @@
+
+
+

+            
+
+
+ 958 +
+
+ 1 +
+
+
    #[test]
+
+
+
+ 959 +
+
+ 1 +
+
+
    fn backwards_compatible() {
+
+
+
+ 960 +
+
+ 5 +
+
+
        #[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
+
+
+
+ 961 +
+
+ 1 +
+
+
        struct Canary {
+
+
+
+ 962 +
+
+ 1 +
+
+
            name: String,
+
+
+
+ 963 +
+
+ 1 +
+
+
            id: u64,
+
+
+
+ 964 +
+
+ 1 +
+
+
        }
+
+
+
+ 965 +
+
+ 1 +
+
+

+            
+
+
+ 966 +
+
+ 1 +
+
+
        let canary = Canary {
+
+
+
+ 967 +
+
+ 1 +
+
+
            name: String::from("coalmine"),
+
+
+
+ 968 +
+
+ 1 +
+
+
            id: 0xfeed_d0d0_dead_beef,
+
+
+
+ 969 +
+
+ 1 +
+
+
        };
+
+
+
+ 970 +
+
+ 1 +
+
+

+            
+
+
+ 971 +
+
+ 1 +
+
+
        // This payload was generated with pot 1.0 using the same structure.
+
+
+
+ 972 +
+
+ 1 +
+
+
        // This structure should be updated to be more encompassing, but this at
+
+
+
+ 973 +
+
+ 1 +
+
+
        // least tests for basic compatibility.
+
+
+
+ 974 +
+
+ 1 +
+
+
        let v1_canary = [
+
+
+
+ 975 +
+
+ 1 +
+
+
            80, 111, 116, 0, 162, 200, 110, 97, 109, 101, 232, 99, 111, 97, 108, 109, 105, 110,
+
+
+
+ 976 +
+
+ 1 +
+
+
            101, 196, 105, 100, 71, 239, 190, 173, 222, 208, 208, 237, 254,
+
+
+
+ 977 +
+
+ 1 +
+
+
        ];
+
+
+
+ 978 +
+
+ 1 +
+
+
        let parsed: Canary = crate::from_slice(&v1_canary).unwrap();
+
+
+
+ 979 +
+
+ 1 +
+
+
        assert_eq!(canary, parsed);
+
+
+
+ 980 +
+
+ 1 +
+
+
    }
+
+
+
+ 981 +
+
+
}
@@ -12480,7 +12792,7 @@
diff --git a/coverage/pot/src/reader.rs.html b/coverage/pot/src/reader.rs.html index 966ebdf0..931b84cf 100644 --- a/coverage/pot/src/reader.rs.html +++ b/coverage/pot/src/reader.rs.html @@ -1071,7 +1071,7 @@
- 168 + 169
    fn from(data: &'a [u8]) -> Self {
@@ -1084,7 +1084,7 @@
- 168 + 169
        Self { data }
@@ -1097,7 +1097,7 @@
- 168 + 169
    }
@@ -1253,7 +1253,7 @@
- 35216 + 35143
    fn buffered_read_bytes(
@@ -1266,7 +1266,7 @@
- 35216 + 35143
        &mut self,
@@ -1279,7 +1279,7 @@
- 35216 + 35143
        length: usize,
@@ -1292,7 +1292,7 @@
- 35216 + 35143
        _scratch: &mut Vec<u8>,
@@ -1305,7 +1305,7 @@
- 35216 + 35143
    ) -> Result<BufferedBytes<'de>, Error> {
@@ -1318,7 +1318,7 @@
- 35216 + 35143
        if length > self.data.len() {
@@ -1370,7 +1370,7 @@
- 35215 + 35142
            let (start, remaining) = self.data.split_at(length);
@@ -1383,7 +1383,7 @@
- 35215 + 35142
            self.data = remaining;
@@ -1396,7 +1396,7 @@
- 35215 + 35142
            Ok(BufferedBytes::Data(start))
@@ -1422,7 +1422,7 @@
- 35216 + 35143
    }
@@ -1487,7 +1487,7 @@
- 222875 + 222766
    fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
@@ -1500,7 +1500,7 @@
- 222875 + 222766
        let remaining_length = self.data.len();
@@ -1513,7 +1513,7 @@
- 222875 + 222766
        let (to_copy, remaining) = self.data.split_at(remaining_length.min(buf.len()));
@@ -1526,7 +1526,7 @@
- 222875 + 222766
        buf[..to_copy.len()].copy_from_slice(to_copy);
@@ -1539,7 +1539,7 @@
- 222875 + 222766
        self.data = remaining;
@@ -1552,7 +1552,7 @@
- 222875 + 222766
        Ok(to_copy.len())
@@ -1565,7 +1565,7 @@
- 222875 + 222766
    }
@@ -1604,7 +1604,7 @@
- 222875 + 222766
    fn read_exact(&mut self, buf: &mut [u8]) -> std::io::Result<()> {
@@ -1617,7 +1617,7 @@
- 889037 + 888580
        self.read(buf).map(|_| ())
@@ -1630,7 +1630,7 @@
- 222875 + 222766
    }
@@ -2470,7 +2470,7 @@
diff --git a/coverage/pot/src/ser.rs.html b/coverage/pot/src/ser.rs.html index a8b62040..9b99a31c 100644 --- a/coverage/pot/src/ser.rs.html +++ b/coverage/pot/src/ser.rs.html @@ -2449,7 +2449,7 @@
- 980130 + 979572
    #[cfg_attr(feature = "tracing", instrument)]
@@ -2462,7 +2462,7 @@
- 490071 + 489792
    #[inline]
@@ -2631,7 +2631,7 @@
- 139926 + 140484
    #[cfg_attr(feature = "tracing", instrument)]
@@ -2644,7 +2644,7 @@
- 69966 + 70245
    #[inline]
@@ -2722,7 +2722,7 @@
- 140092 + 139534
    #[cfg_attr(feature = "tracing", instrument(level = "trace", skip(value)))]
@@ -6830,7 +6830,7 @@
- 14059214 + 14057074
            .binary_search_by(|check| (check.0.as_ptr() as usize).cmp(&symbol_address))
@@ -15678,7 +15678,7 @@
diff --git a/coverage/pot/src/value.rs.html b/coverage/pot/src/value.rs.html index 13a970d1..db30d074 100644 --- a/coverage/pot/src/value.rs.html +++ b/coverage/pot/src/value.rs.html @@ -29731,7 +29731,7 @@