From 297ae5bde7ba29927443bfd2a4a47b99401ecc45 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 25 Jan 2024 13:20:17 +0200 Subject: [PATCH 01/11] fix: set GSA fix_stas_prn from 12 to 18 Signed-off-by: Lachezar Lechev --- src/parser.rs | 2 +- src/sentences/gsa.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 5fe3fe4..709853a 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -52,7 +52,7 @@ pub struct Nmea { pub pdop: Option, /// Geoid separation in meters pub geoid_separation: Option, - pub fix_satellites_prns: Option>, + pub fix_satellites_prns: Option>, satellites_scan: [SatsPack; GnssType::COUNT], required_sentences_for_nav: SentenceMask, last_fix_time: Option, diff --git a/src/sentences/gsa.rs b/src/sentences/gsa.rs index ba6805e..c537db9 100644 --- a/src/sentences/gsa.rs +++ b/src/sentences/gsa.rs @@ -44,7 +44,7 @@ pub enum GsaMode2 { pub struct GsaData { pub mode1: GsaMode1, pub mode2: GsaMode2, - pub fix_sats_prn: Vec, + pub fix_sats_prn: Vec, pub pdop: Option, pub hdop: Option, pub vdop: Option, @@ -53,7 +53,7 @@ pub struct GsaData { /// This function is take from `nom`, see `nom::multi::many0` /// with one difference - we use a [`heapless::Vec`] /// because we want `no_std` & no `alloc` -fn many0(mut f: F) -> impl FnMut(I) -> IResult, E> +fn many0(mut f: F) -> impl FnMut(I) -> IResult, E> where I: Clone + InputLength, F: Parser, @@ -61,7 +61,7 @@ where O: core::fmt::Debug, { move |mut i: I| { - let mut acc = Vec::<_, 12>::new(); + let mut acc = Vec::<_, 18>::new(); loop { let len = i.input_len(); match f.parse(i.clone()) { @@ -81,11 +81,11 @@ where } } -fn gsa_prn_fields_parse(i: &str) -> IResult<&str, Vec, 12>> { +fn gsa_prn_fields_parse(i: &str) -> IResult<&str, Vec, 18>> { many0(terminated(opt(number::), char(',')))(i) } -type GsaTail = (Vec, 12>, Option, Option, Option); +type GsaTail = (Vec, 18>, Option, Option, Option); fn do_parse_gsa_tail(i: &str) -> IResult<&str, GsaTail> { let (i, prns) = gsa_prn_fields_parse(i)?; @@ -129,7 +129,7 @@ fn do_parse_gsa(i: &str) -> IResult<&str, GsaData> { _ => unreachable!(), }, fix_sats_prn: { - let mut fix_sats_prn = Vec::::new(); + let mut fix_sats_prn = Vec::::new(); for sat in tail.0.iter().flatten() { fix_sats_prn.push(*sat).unwrap() } @@ -228,7 +228,7 @@ mod tests { GsaData { mode1: GsaMode1::Automatic, mode2: GsaMode2::Fix3D, - fix_sats_prn: Vec::<_, 12>::from_slice(&[16, 18, 22, 24]).unwrap(), + fix_sats_prn: Vec::from_slice(&[16, 18, 22, 24]).unwrap(), pdop: Some(3.6), hdop: Some(2.1), vdop: Some(2.2), From 26dce8575efcd54e75f7302fd1c4013dd52a2dd2 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 25 Jan 2024 12:07:39 +0200 Subject: [PATCH 02/11] feat: bump heapless to 0.8 and add `defmt-03` feature Signed-off-by: Lachezar Lechev --- Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e502644..a57a8bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] arrayvec = { version = "0.7", default-features = false } chrono = { version = "0.4", default-features = false } -heapless = "0.7" +heapless = "0.8" nom = { version = "7.1", default-features = false } # we include num-traits only when `std` is not enabled @@ -38,6 +38,8 @@ cfg-if = "1" serde = { version = "1.0", default-features = false, optional = true } serde_with = { version = "3.0", default-features = false, optional = true } +defmt = { version = "0.3", optional = true } + [dev-dependencies] approx = "0.5" doc-comment = "0.3" @@ -59,6 +61,8 @@ serde = [ "arrayvec/serde" ] +defmt-03 = ["dep:defmt", "heapless/defmt-03"] + all-sentences = ["GNSS", "waypoint", "maritime", "water", "vendor-specific", "other"] # GNSS specific sentences related to the possition or speed relative to the ground GNSS = ["ALM", "GBS", "GGA", "GLL", "GNS", "GSA", "GSV", "RMC", "VTG"] From 7deef37db313dbbb7048bb3fdc8e181f5a6e7131 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 25 Jan 2024 13:49:12 +0200 Subject: [PATCH 03/11] feat: derive(defmt::Format) for all sentence *Data structs Signed-off-by: Lachezar Lechev --- src/sentences/aam.rs | 1 + src/sentences/alm.rs | 1 + src/sentences/bod.rs | 1 + src/sentences/bwc.rs | 1 + src/sentences/bww.rs | 1 + src/sentences/dbk.rs | 1 + src/sentences/faa_mode.rs | 2 ++ src/sentences/fix_type.rs | 1 + src/sentences/gbs.rs | 1 + src/sentences/gga.rs | 1 + src/sentences/gll.rs | 1 + src/sentences/gns.rs | 2 ++ src/sentences/gnss_type.rs | 1 + src/sentences/gsa.rs | 3 +++ src/sentences/gsv.rs | 1 + src/sentences/hdt.rs | 1 + src/sentences/mda.rs | 1 + src/sentences/mtw.rs | 2 ++ src/sentences/mwv.rs | 3 +++ src/sentences/rmc.rs | 3 +++ src/sentences/rmz.rs | 2 ++ src/sentences/txt.rs | 1 + src/sentences/vhw.rs | 1 + src/sentences/vtg.rs | 1 + src/sentences/zda.rs | 1 + src/sentences/zfo.rs | 1 + src/sentences/ztg.rs | 1 + 27 files changed, 37 insertions(+) diff --git a/src/sentences/aam.rs b/src/sentences/aam.rs index 2818c01..cdd2c1f 100644 --- a/src/sentences/aam.rs +++ b/src/sentences/aam.rs @@ -34,6 +34,7 @@ use crate::{parse::NmeaSentence, sentences::utils::array_string, Error, Sentence /// WPTNME is the waypoint name. /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct AamData { pub arrival_circle_entered: Option, diff --git a/src/sentences/alm.rs b/src/sentences/alm.rs index eee6088..4560eb5 100644 --- a/src/sentences/alm.rs +++ b/src/sentences/alm.rs @@ -48,6 +48,7 @@ use super::utils::number; /// /// Fields 5 through 15 are dumped as raw hex. #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct AlmData { pub total_number_of_messages: Option, diff --git a/src/sentences/bod.rs b/src/sentences/bod.rs index 8849efd..6919ace 100644 --- a/src/sentences/bod.rs +++ b/src/sentences/bod.rs @@ -22,6 +22,7 @@ use serde::{Deserialize, Serialize}; /// $--BOD,x.x,T,x.x,M,c--c,c--c*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq)] pub struct BodData { pub bearing_true: Option, diff --git a/src/sentences/bwc.rs b/src/sentences/bwc.rs index 13f0a1c..57b02d3 100644 --- a/src/sentences/bwc.rs +++ b/src/sentences/bwc.rs @@ -24,6 +24,7 @@ use crate::{ /// $--BWC,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x.x,T,x.x,M,x.x,N,c--c,m,*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct BwcData { pub fix_time: Option, diff --git a/src/sentences/bww.rs b/src/sentences/bww.rs index 62d15e2..da9fb3b 100644 --- a/src/sentences/bww.rs +++ b/src/sentences/bww.rs @@ -33,6 +33,7 @@ use super::utils::array_string; /// 7. Checksum #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct BwwData { pub true_bearing: Option, diff --git a/src/sentences/dbk.rs b/src/sentences/dbk.rs index d01b6e5..d72d371 100644 --- a/src/sentences/dbk.rs +++ b/src/sentences/dbk.rs @@ -28,6 +28,7 @@ use crate::{parse::NmeaSentence, Error, ParseResult, SentenceType}; /// 6: F = Fathoms /// 7: Mandatory NMEA checksum #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct DbkData { pub depth_feet: Option, diff --git a/src/sentences/faa_mode.rs b/src/sentences/faa_mode.rs index 90dcf4c..ac51973 100644 --- a/src/sentences/faa_mode.rs +++ b/src/sentences/faa_mode.rs @@ -7,6 +7,7 @@ use super::{nom_parse_failure, FixType}; /// for now let's handle only two GPS and GLONASS #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct FaaModes { sys_state0: FaaMode, @@ -29,6 +30,7 @@ impl From for FixType { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum FaaMode { /// A - Autonomous mode diff --git a/src/sentences/fix_type.rs b/src/sentences/fix_type.rs index e431493..412bf98 100644 --- a/src/sentences/fix_type.rs +++ b/src/sentences/fix_type.rs @@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize}; /// Fix type #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum FixType { Invalid, diff --git a/src/sentences/gbs.rs b/src/sentences/gbs.rs index 8bd2dd0..5cbe8c1 100644 --- a/src/sentences/gbs.rs +++ b/src/sentences/gbs.rs @@ -20,6 +20,7 @@ use crate::{ /// $--GBS,hhmmss.ss,x.x,x.x,x.x,x.x,x.x,x.x,x.x*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq)] pub struct GbsData { pub time: Option, diff --git a/src/sentences/gga.rs b/src/sentences/gga.rs index f3b04fb..4df55d8 100644 --- a/src/sentences/gga.rs +++ b/src/sentences/gga.rs @@ -30,6 +30,7 @@ use crate::{ /// $--GGA,hhmmss.ss,ddmm.mm,a,ddmm.mm,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct GgaData { #[cfg_attr( diff --git a/src/sentences/gll.rs b/src/sentences/gll.rs index 52077d6..f0b8565 100644 --- a/src/sentences/gll.rs +++ b/src/sentences/gll.rs @@ -33,6 +33,7 @@ use crate::{ /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct GllData { pub latitude: Option, diff --git a/src/sentences/gns.rs b/src/sentences/gns.rs index 563fd25..33daf02 100644 --- a/src/sentences/gns.rs +++ b/src/sentences/gns.rs @@ -28,6 +28,7 @@ use crate::{parse::NmeaSentence, Error, SentenceType}; /// $--GNS,hhmmss.ss,ddmm.mm,a,dddmm.mm,a,c--c,xx,x.x,x.x,x.x,x.x,x.x*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct GnsData { pub fix_time: Option, @@ -42,6 +43,7 @@ pub struct GnsData { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum NavigationStatus { Safe, diff --git a/src/sentences/gnss_type.rs b/src/sentences/gnss_type.rs index d6ab56b..9fe005f 100644 --- a/src/sentences/gnss_type.rs +++ b/src/sentences/gnss_type.rs @@ -14,6 +14,7 @@ macro_rules! define_enum_with_count { ) => { $(#[$outer])* #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(PartialEq, Debug, Hash, Eq, Clone, Copy)] #[repr(u8)] pub enum $Name { diff --git a/src/sentences/gsa.rs b/src/sentences/gsa.rs index c537db9..9599522 100644 --- a/src/sentences/gsa.rs +++ b/src/sentences/gsa.rs @@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize}; use crate::{parse::NmeaSentence, sentences::utils::number, Error, SentenceType}; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GsaMode1 { Manual, @@ -23,6 +24,7 @@ pub enum GsaMode1 { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GsaMode2 { NoFix, @@ -40,6 +42,7 @@ pub enum GsaMode2 { /// $--GSA,a,a,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x.x,x.x,x.x*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, PartialEq)] pub struct GsaData { pub mode1: GsaMode1, diff --git a/src/sentences/gsv.rs b/src/sentences/gsv.rs index 1fcfbef..3878fbd 100644 --- a/src/sentences/gsv.rs +++ b/src/sentences/gsv.rs @@ -24,6 +24,7 @@ use crate::{ /// $--GSV,x,x,x,x,x,x,x,...*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct GsvData { pub gnss_type: GnssType, diff --git a/src/sentences/hdt.rs b/src/sentences/hdt.rs index e3bcd95..59ac37f 100644 --- a/src/sentences/hdt.rs +++ b/src/sentences/hdt.rs @@ -24,6 +24,7 @@ use crate::{Error, NmeaSentence, SentenceType}; /// 2. T = True /// 3. Checksum #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct HdtData { /// Heading, degrees True diff --git a/src/sentences/mda.rs b/src/sentences/mda.rs index 48a454b..459c8d8 100644 --- a/src/sentences/mda.rs +++ b/src/sentences/mda.rs @@ -15,6 +15,7 @@ use crate::{parse::NmeaSentence, Error, SentenceType}; /// $--MDA,n.nn,I,n.nnn,B,n.n,C,n.C,n.n,n,n.n,C,n.n,T,n.n,M,n.n,N,n.n,M*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct MdaData { /// Pressure in inches of mercury diff --git a/src/sentences/mtw.rs b/src/sentences/mtw.rs index c1d8484..d82b3cf 100644 --- a/src/sentences/mtw.rs +++ b/src/sentences/mtw.rs @@ -24,12 +24,14 @@ use crate::{parse::NmeaSentence, Error, SentenceType}; /// 2: Unit of Measurement, (only) Celsius /// 3: Mandatory NMEA checksum #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct MtwData { pub temperature: Option, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum MtwUnit { Celsius, diff --git a/src/sentences/mwv.rs b/src/sentences/mwv.rs index dd7cc5e..90fe39d 100644 --- a/src/sentences/mwv.rs +++ b/src/sentences/mwv.rs @@ -21,6 +21,7 @@ use crate::{parse::NmeaSentence, Error, SentenceType}; /// $--MWV,x.x,a,x.x,a*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct MwvData { pub wind_direction: Option, @@ -31,6 +32,7 @@ pub struct MwvData { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum MwvReference { Relative, @@ -38,6 +40,7 @@ pub enum MwvReference { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum MwvWindSpeedUnits { KilometersPerHour, diff --git a/src/sentences/rmc.rs b/src/sentences/rmc.rs index 7d60ef7..85d38c3 100644 --- a/src/sentences/rmc.rs +++ b/src/sentences/rmc.rs @@ -18,6 +18,7 @@ use crate::{ use super::{faa_mode::parse_faa_mode, utils::parse_magnetic_variation, FaaMode}; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum RmcStatusOfFix { Autonomous, @@ -26,6 +27,7 @@ pub enum RmcStatusOfFix { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum RmcNavigationStatus { Autonomous, @@ -78,6 +80,7 @@ pub enum RmcNavigationStatus { /// `A` = autonomous, `D` = differential, `E` = Estimated, /// `M` = Manual input mode, `N` = not valid, `S` = Simulator, `V` = Valid #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq)] pub struct RmcData { pub fix_time: Option, diff --git a/src/sentences/rmz.rs b/src/sentences/rmz.rs index 8064bda..833abaa 100644 --- a/src/sentences/rmz.rs +++ b/src/sentences/rmz.rs @@ -10,6 +10,7 @@ use crate::sentences::utils::number; use crate::{parse::NmeaSentence, Error, SentenceType}; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum PgrmzFixType { NoFix, @@ -34,6 +35,7 @@ pub enum PgrmzFixType { /// /// Example: `$PGRMZ,2282,f,3*21` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct PgrmzData { /// Current altitude in feet diff --git a/src/sentences/txt.rs b/src/sentences/txt.rs index 6b2d936..5334dcc 100644 --- a/src/sentences/txt.rs +++ b/src/sentences/txt.rs @@ -67,6 +67,7 @@ fn do_parse_txt(i: &str) -> IResult<&str, TxtData0<'_>> { /// TXT - Text #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TxtData { pub count: u8, diff --git a/src/sentences/vhw.rs b/src/sentences/vhw.rs index 863ebf2..7fec5b0 100644 --- a/src/sentences/vhw.rs +++ b/src/sentences/vhw.rs @@ -35,6 +35,7 @@ use super::utils::parse_float_num; /// > [[GLOBALSAT](https://gpsd.gitlab.io/gpsd/NMEA.html#GLOBALSAT)] describes a different format in which the first three fields are water-temperature measurements. /// > It’s not clear which is correct. #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Clone, PartialEq, Debug)] pub struct VhwData { /// Heading degrees, True diff --git a/src/sentences/vtg.rs b/src/sentences/vtg.rs index b60f02c..ffb6165 100644 --- a/src/sentences/vtg.rs +++ b/src/sentences/vtg.rs @@ -21,6 +21,7 @@ use crate::{parse::NmeaSentence, Error, SentenceType}; /// $--VTG,x.x,T,x.x,M,x.x,N,x.x,K,m*hh /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq)] pub struct VtgData { pub true_course: Option, diff --git a/src/sentences/zda.rs b/src/sentences/zda.rs index 63c84f2..83d13fd 100644 --- a/src/sentences/zda.rs +++ b/src/sentences/zda.rs @@ -31,6 +31,7 @@ use super::utils::{parse_num, parse_number_in_range}; /// 6. Local zone minutes description, 00 to 59, apply same sign as local hours /// 7. Checksum #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, PartialEq, Eq)] pub struct ZdaData { pub utc_time: Option, diff --git a/src/sentences/zfo.rs b/src/sentences/zfo.rs index 6ced9f8..ebc1aa0 100644 --- a/src/sentences/zfo.rs +++ b/src/sentences/zfo.rs @@ -26,6 +26,7 @@ use crate::{ /// 3. Origin Waypoint ID /// 4. Checksum #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq, Eq)] pub struct ZfoData { pub fix_time: Option, diff --git a/src/sentences/ztg.rs b/src/sentences/ztg.rs index 32c52aa..309bc05 100644 --- a/src/sentences/ztg.rs +++ b/src/sentences/ztg.rs @@ -28,6 +28,7 @@ use super::utils::array_string; /// 3. Destination Waypoint ID /// 4. Checksum #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq, Eq)] pub struct ZtgData { pub fix_time: Option, From ae437eb650c8cc0a06f2f369b3226a4ab94a667d Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 25 Jan 2024 13:49:27 +0200 Subject: [PATCH 04/11] feat: derive(defmt::Format) for the rest of the structs/enums Signed-off-by: Lachezar Lechev --- src/parse.rs | 2 ++ src/parser.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/parse.rs b/src/parse.rs index 8ed2b61..b47d91a 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -38,6 +38,7 @@ pub const TEXT_PARAMETER_MAX_LEN: usize = 64; /// A known and parsable Nmea sentence type. #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] pub struct NmeaSentence<'a> { pub talker_id: &'a str, pub message_id: SentenceType, @@ -104,6 +105,7 @@ pub fn parse_nmea_sentence(sentence: &str) -> core::result::Result, @@ -436,6 +437,7 @@ impl fmt::Display for Nmea { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Default)] struct SatsPack { /// max number of visible GNSS satellites per hemisphere, assuming global coverage @@ -497,6 +499,7 @@ mod serde_deq { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Clone, PartialEq)] /// Satellite information pub struct Satellite { @@ -760,6 +763,7 @@ define_sentence_type_enum! { /// /// - [`SentenceType::RMZ`] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] #[repr(u32)] #[allow(rustdoc::bare_urls)] @@ -1244,6 +1248,7 @@ define_sentence_type_enum! { } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug, Default)] pub struct SentenceMask { mask: u128, From 1902742e32db9d8c95b450efc9c352283dfee599 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 25 Jan 2024 13:49:35 +0200 Subject: [PATCH 05/11] docs(features): crate docs - add `defmt-03` the the features list Signed-off-by: Lachezar Lechev --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 839eee4..b7cc53e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,7 +46,8 @@ //! //! - `default` features - `std` //! - `std` - enable `std` -//! - `serde` - enable `serde` +//! - `serde` - enable `serde` Serialize and Deserialize derives +//! - `defmt-03` - enable the `defmt@0.3` Format derives //! //! [`Nmea::parse()`]: Nmea::parse //! [`Nmea::parse_for_fix()`]: Nmea::parse_for_fix From 6b49de9ece51639e12177ec40f42aabe7daefbeb Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Sat, 27 Jan 2024 11:09:10 +0200 Subject: [PATCH 06/11] fix: apply defmt::Debug2Format to fields of dep. structs Signed-off-by: Lachezar Lechev --- src/parser.rs | 4 ++++ src/sentences/aam.rs | 1 + src/sentences/bod.rs | 2 ++ src/sentences/bwc.rs | 2 ++ src/sentences/bww.rs | 2 ++ src/sentences/gbs.rs | 1 + src/sentences/gga.rs | 1 + src/sentences/gll.rs | 1 + src/sentences/gns.rs | 1 + src/sentences/rmc.rs | 2 ++ src/sentences/txt.rs | 1 + src/sentences/zda.rs | 1 + src/sentences/zfo.rs | 3 +++ src/sentences/ztg.rs | 3 +++ 14 files changed, 25 insertions(+) diff --git a/src/parser.rs b/src/parser.rs index 64a08d8..298cb38 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -38,7 +38,9 @@ use serde::{de::Visitor, ser::SerializeSeq, Deserialize, Serialize}; #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Default)] pub struct Nmea { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_date: Option, pub fix_type: Option, pub latitude: Option, @@ -56,6 +58,7 @@ pub struct Nmea { pub fix_satellites_prns: Option>, satellites_scan: [SatsPack; GnssType::COUNT], required_sentences_for_nav: SentenceMask, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] last_fix_time: Option, last_txt: Option, sentences_for_this_time: SentenceMask, @@ -447,6 +450,7 @@ struct SatsPack { /// Galileo: 12 /// => 58 total Satellites => max 15 rows of data #[cfg_attr(feature = "serde", serde(with = "serde_deq"))] + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] data: Deque, 4>, 15>, max_len: usize, } diff --git a/src/sentences/aam.rs b/src/sentences/aam.rs index cdd2c1f..d6bbcb5 100644 --- a/src/sentences/aam.rs +++ b/src/sentences/aam.rs @@ -41,6 +41,7 @@ pub struct AamData { pub perpendicular_passed: Option, pub arrival_circle_radius: Option, pub radius_units: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub waypoint_id: Option>, } diff --git a/src/sentences/bod.rs b/src/sentences/bod.rs index 6919ace..23f1725 100644 --- a/src/sentences/bod.rs +++ b/src/sentences/bod.rs @@ -27,7 +27,9 @@ use serde::{Deserialize, Serialize}; pub struct BodData { pub bearing_true: Option, pub bearing_magnetic: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub to_waypoint: Option>, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub from_waypoint: Option>, } diff --git a/src/sentences/bwc.rs b/src/sentences/bwc.rs index 57b02d3..9d55a9d 100644 --- a/src/sentences/bwc.rs +++ b/src/sentences/bwc.rs @@ -27,12 +27,14 @@ use crate::{ #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct BwcData { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: Option, pub latitude: Option, pub longitude: Option, pub true_bearing: Option, pub magnetic_bearing: Option, pub distance: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub waypoint_id: Option>, } diff --git a/src/sentences/bww.rs b/src/sentences/bww.rs index da9fb3b..f19bf47 100644 --- a/src/sentences/bww.rs +++ b/src/sentences/bww.rs @@ -38,7 +38,9 @@ use super::utils::array_string; pub struct BwwData { pub true_bearing: Option, pub magnetic_bearing: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub to_waypoint_id: Option>, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub from_waypoint_id: Option>, } diff --git a/src/sentences/gbs.rs b/src/sentences/gbs.rs index 5cbe8c1..e7ac18d 100644 --- a/src/sentences/gbs.rs +++ b/src/sentences/gbs.rs @@ -23,6 +23,7 @@ use crate::{ #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq)] pub struct GbsData { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub time: Option, pub lat_error: Option, pub lon_error: Option, diff --git a/src/sentences/gga.rs b/src/sentences/gga.rs index 4df55d8..6d2b1bf 100644 --- a/src/sentences/gga.rs +++ b/src/sentences/gga.rs @@ -37,6 +37,7 @@ pub struct GgaData { not(feature = "std"), cfg_attr(feature = "serde", serde(with = "serde_naive_time")) )] + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: Option, pub fix_type: Option, pub latitude: Option, diff --git a/src/sentences/gll.rs b/src/sentences/gll.rs index f0b8565..aede6b5 100644 --- a/src/sentences/gll.rs +++ b/src/sentences/gll.rs @@ -38,6 +38,7 @@ use crate::{ pub struct GllData { pub latitude: Option, pub longitude: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: NaiveTime, pub valid: bool, pub faa_mode: Option, diff --git a/src/sentences/gns.rs b/src/sentences/gns.rs index 33daf02..3ca6445 100644 --- a/src/sentences/gns.rs +++ b/src/sentences/gns.rs @@ -31,6 +31,7 @@ use crate::{parse::NmeaSentence, Error, SentenceType}; #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq)] pub struct GnsData { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: Option, pub lat: Option, pub lon: Option, diff --git a/src/sentences/rmc.rs b/src/sentences/rmc.rs index 85d38c3..5b19c50 100644 --- a/src/sentences/rmc.rs +++ b/src/sentences/rmc.rs @@ -83,7 +83,9 @@ pub enum RmcNavigationStatus { #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, Copy, PartialEq)] pub struct RmcData { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_date: Option, pub status_of_fix: RmcStatusOfFix, pub lat: Option, diff --git a/src/sentences/txt.rs b/src/sentences/txt.rs index 5334dcc..2d3c0ba 100644 --- a/src/sentences/txt.rs +++ b/src/sentences/txt.rs @@ -73,6 +73,7 @@ pub struct TxtData { pub count: u8, pub seq: u8, pub text_ident: u8, + #[cfg_attr(feature = "defmt-03", defmt(Display2Format))] pub text: ArrayString, } diff --git a/src/sentences/zda.rs b/src/sentences/zda.rs index 83d13fd..9a42ef9 100644 --- a/src/sentences/zda.rs +++ b/src/sentences/zda.rs @@ -34,6 +34,7 @@ use super::utils::{parse_num, parse_number_in_range}; #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, Clone, PartialEq, Eq)] pub struct ZdaData { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub utc_time: Option, pub day: Option, pub month: Option, diff --git a/src/sentences/zfo.rs b/src/sentences/zfo.rs index ebc1aa0..f7835bb 100644 --- a/src/sentences/zfo.rs +++ b/src/sentences/zfo.rs @@ -29,12 +29,15 @@ use crate::{ #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq, Eq)] pub struct ZfoData { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: Option, #[cfg_attr( feature = "serde", serde(with = "As::>>") )] + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_duration: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub waypoint_id: Option>, } diff --git a/src/sentences/ztg.rs b/src/sentences/ztg.rs index 309bc05..c8da2ab 100644 --- a/src/sentences/ztg.rs +++ b/src/sentences/ztg.rs @@ -31,12 +31,15 @@ use super::utils::array_string; #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[derive(Debug, PartialEq, Eq)] pub struct ZtgData { + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_time: Option, #[cfg_attr( feature = "serde", serde(with = "As::>>") )] + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub fix_duration: Option, + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub waypoint_id: Option>, } From 202b32fee1c3b188f26b260c71adb1254e134194 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Sat, 27 Jan 2024 11:10:51 +0200 Subject: [PATCH 07/11] chore: update Cargo.lock Signed-off-by: Lachezar Lechev --- Cargo.lock | 166 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 104 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1d01e0..2fede5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,15 +50,6 @@ dependencies = [ "serde", ] -[[package]] -name = "atomic-polyfill" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" -dependencies = [ - "critical-section", -] - [[package]] name = "atty" version = "0.2.14" @@ -224,12 +215,6 @@ dependencies = [ "itertools", ] -[[package]] -name = "critical-section" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -284,7 +269,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.39", ] [[package]] @@ -295,7 +280,39 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.39", +] + +[[package]] +name = "defmt" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" +dependencies = [ + "bitflags", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" +dependencies = [ + "defmt-parser", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "defmt-parser" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" +dependencies = [ + "thiserror", ] [[package]] @@ -357,9 +374,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hash32" -version = "0.2.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" dependencies = [ "byteorder", ] @@ -378,15 +395,13 @@ checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heapless" -version = "0.7.16" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "atomic-polyfill", + "defmt", "hash32", - "rustc_version", "serde", - "spin", "stable_deref_trait", ] @@ -498,16 +513,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.20" @@ -544,6 +549,7 @@ dependencies = [ "cfg-if", "chrono", "criterion", + "defmt", "doc-comment", "heapless", "nom", @@ -637,6 +643,30 @@ dependencies = [ "yansi", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.69" @@ -731,15 +761,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "ryu" version = "1.0.15" @@ -761,12 +782,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "semver" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" - [[package]] name = "serde" version = "1.0.193" @@ -784,7 +799,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -824,16 +839,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", + "syn 2.0.39", ] [[package]] @@ -848,6 +854,16 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.39" @@ -865,6 +881,26 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +[[package]] +name = "thiserror" +version = "1.0.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e3de26b0965292219b4287ff031fcba86837900fe9cd2b34ea8ad893c0953d2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "time" version = "0.3.30" @@ -910,6 +946,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + [[package]] name = "walkdir" version = "2.4.0" @@ -947,7 +989,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -969,7 +1011,7 @@ checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] From 5487af2ce5ffd4435f6a9e5df9e2b03578c21bf5 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Wed, 31 Jan 2024 10:26:05 +0200 Subject: [PATCH 08/11] chore: Cargo - upgrade dependencies Signed-off-by: Lachezar Lechev --- Cargo.lock | 255 ++++++++++++++++++++++++++--------------------------- 1 file changed, 124 insertions(+), 131 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1d01e0..6581a4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,9 +52,9 @@ dependencies = [ [[package]] name = "atomic-polyfill" -version = "0.1.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" dependencies = [ "critical-section", ] @@ -78,9 +78,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" @@ -123,9 +123,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -147,15 +147,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "criterion" @@ -232,42 +232,40 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "darling" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" dependencies = [ "darling_core", "darling_macro", @@ -275,9 +273,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" dependencies = [ "fnv", "ident_case", @@ -289,9 +287,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", "quote", @@ -300,9 +298,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -340,9 +338,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -351,9 +349,13 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hash32" @@ -372,15 +374,15 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heapless" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", "hash32", @@ -407,9 +409,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -447,12 +449,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "serde", ] @@ -467,15 +469,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -488,9 +490,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libm" @@ -516,18 +518,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minimal-lexical" @@ -577,9 +570,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -639,9 +632,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -657,9 +650,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -684,9 +677,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -694,9 +687,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -704,9 +697,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -716,9 +709,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -742,9 +735,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -763,24 +756,24 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -789,9 +782,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -800,15 +793,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.1.0", + "indexmap 2.2.1", "serde", "serde_json", "serde_with_macros", @@ -817,9 +810,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" dependencies = [ "darling", "proc-macro2", @@ -850,9 +843,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -867,9 +860,9 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -887,9 +880,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -928,9 +921,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -938,9 +931,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -953,9 +946,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -963,9 +956,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -976,15 +969,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -1023,18 +1016,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1047,45 +1040,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "yansi" From 9ded56452c2f492fe8e4fffd490d0ce365749d83 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Tue, 13 Feb 2024 10:59:07 +0200 Subject: [PATCH 09/11] chore: add derive(Format) for WncData Signed-off-by: Lachezar Lechev --- src/sentences/wnc.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/sentences/wnc.rs b/src/sentences/wnc.rs index 02f05b2..5a07c0d 100644 --- a/src/sentences/wnc.rs +++ b/src/sentences/wnc.rs @@ -1,12 +1,16 @@ +use arrayvec::ArrayString; +use nom::{ + bytes::complete::is_not, character::complete::char, combinator::opt, number::complete::float, +}; + +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + use super::utils::array_string; use crate::{ parse::{NmeaSentence, TEXT_PARAMETER_MAX_LEN}, Error, SentenceType, }; -use arrayvec::ArrayString; -use nom::{ - bytes::complete::is_not, character::complete::char, combinator::opt, number::complete::float, -}; /// WNC - Distance - Waypoint to Waypoint /// @@ -28,16 +32,19 @@ use nom::{ /// 4. K = Kilometers /// 5. Waypoint ID, Destination /// 6. Waypoint ID, Origin - #[derive(Debug, PartialEq)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] pub struct WncData { /// Distance, Nautical Miles pub distance_nautical_miles: Option, /// Distance, Kilometers pub distance_kilometers: Option, /// Waypoint ID, Destination + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub waypoint_id_destination: Option>, /// Waypoint ID, Origin + #[cfg_attr(feature = "defmt-03", defmt(Debug2Format))] pub waypoint_id_origin: Option>, } From d35c6000060cc8862c5a1787e9c8bb478492ffa6 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Tue, 13 Feb 2024 16:51:03 +0200 Subject: [PATCH 10/11] fix(CI): workflow excludes `defmt-03` feature Signed-off-by: Lachezar Lechev --- .github/workflows/ci.yml | 27 ++++++++++++--------------- Cargo.toml | 4 ++-- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3da6ff6..d2a2511 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,16 +19,14 @@ concurrency: env: RUST_BACKTRACE: 1 + RUSTUP_MAX_RETRIES: 10 + CARGO_NET_RETRY: 10 + jobs: lints: name: Rustfmt & Clippy lints runs-on: ubuntu-latest - # strategy: - # fail-fast: false - env: - RUSTUP_MAX_RETRIES: 10 - CARGO_NET_RETRY: 10 steps: - uses: actions/checkout@v3 @@ -53,9 +51,6 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] rust: ["1.65", stable, beta] - env: - RUSTUP_MAX_RETRIES: 10 - CARGO_NET_RETRY: 10 steps: - uses: actions/checkout@v3 @@ -70,15 +65,17 @@ jobs: - name: Test --no-default-features run: cargo test --no-default-features - - - name: Test --all-features - run: cargo test --all-features + + - name: Test all features excluding `defmt-03` + # this includes default features, `std` and `all-sentences` + run: cargo test -F serde - name: Test (Release) run: cargo test --release --no-default-features - - name: Test (Release) --all-features - run: cargo test --release --all-features + - name: Test (Release) all features excluding `defmt-03` + # this includes default features, `std` and `all-sentences` + run: cargo test --release -F serde # Detect cases where documentation links don't resolve and such. doc: @@ -109,8 +106,8 @@ jobs: uses: actions/checkout@v3 - name: Generate code coverage - run: | - cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml + # this includes default features, `std` and `all-sentences` + run: cargo +nightly tarpaulin --features serde --verbose --workspace --timeout 120 --out xml - name: Upload to codecov.io uses: codecov/codecov-action@v3 diff --git a/Cargo.toml b/Cargo.toml index 8666e81..0755222 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ nom = { version = "7.1", default-features = false } # we include num-traits only when `std` is not enabled # because of `fract()` and `trunc()` methods -num-traits = { version = "0.2", default-features = false, features = ["libm"]} +num-traits = { version = "0.2", default-features = false, features = ["libm"] } cfg-if = "1" serde = { version = "1.0", default-features = false, optional = true } serde_with = { version = "3.0", default-features = false, optional = true } @@ -47,7 +47,7 @@ doc-comment = "0.3" pretty_assertions = "1" quickcheck = { version = "1", default-features = false } # criterion 0.5.1 requires at least Rust 1.70 because of clap v4.4.0. -criterion = "0.4" +criterion = "=0.4" serde_json = "1.0" [features] From af2edeb26afd8e49e9d4e0914dbfe912602c967e Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Tue, 13 Feb 2024 18:21:53 +0200 Subject: [PATCH 11/11] chore: move benches to separate crate to avoid bumping MSRV Signed-off-by: Lachezar Lechev --- .github/workflows/ci.yml | 12 + Cargo.lock | 406 +++++++++--------- Cargo.toml | 11 +- benches-harness/Cargo.toml | 19 + .../benches}/gsv_parser.rs | 0 .../benches}/nom_parsing.rs | 0 benches-harness/src/lib.rs | 2 + 7 files changed, 239 insertions(+), 211 deletions(-) create mode 100644 benches-harness/Cargo.toml rename {benches => benches-harness/benches}/gsv_parser.rs (100%) rename {benches => benches-harness/benches}/nom_parsing.rs (100%) create mode 100644 benches-harness/src/lib.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2a2511..694ba0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,18 @@ jobs: # this includes default features, `std` and `all-sentences` run: cargo test --release -F serde + bench: + name: Benches + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Run Benches + run: cargo bench -p benches-harness + # Detect cases where documentation links don't resolve and such. doc: name: Docs check diff --git a/Cargo.lock b/Cargo.lock index 2fede5f..75b248b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,6 +32,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + [[package]] name = "approx" version = "0.5.1" @@ -50,17 +56,6 @@ dependencies = [ "serde", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -69,9 +64,18 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "benches-harness" +version = "0.1.0" +dependencies = [ + "criterion", + "nmea", + "nom", +] [[package]] name = "bitflags" @@ -114,9 +118,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", @@ -127,9 +131,9 @@ dependencies = [ [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -138,15 +142,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -154,46 +158,50 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ - "bitflags", - "clap_lex", - "indexmap 1.9.3", - "textwrap", + "clap_builder", ] [[package]] -name = "clap_lex" -version = "0.2.4" +name = "clap_builder" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ - "os_str_bytes", + "anstyle", + "clap_lex", ] +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "criterion" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ "anes", - "atty", "cast", "ciborium", "clap", "criterion-plot", + "is-terminal", "itertools", - "lazy_static", "num-traits", + "once_cell", "oorandom", "plotters", "rayon", @@ -217,42 +225,40 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "darling" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" dependencies = [ "darling_core", "darling_macro", @@ -260,34 +266,34 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "defmt" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" +checksum = "3939552907426de152b3c2c6f51ed53f98f448babd26f28694c95f5906194595" dependencies = [ "bitflags", "defmt-macros", @@ -295,31 +301,31 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" +checksum = "18bdc7a7b92ac413e19e95240e75d3a73a8d8e78aa24a594c22cbb4d44b4bbda" dependencies = [ "defmt-parser", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "defmt-parser" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" +checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" dependencies = [ "thiserror", ] [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -339,9 +345,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "equivalent" @@ -357,9 +363,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -368,9 +374,13 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hash32" @@ -389,9 +399,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heapless" @@ -407,12 +417,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -422,9 +429,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -462,15 +469,26 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "serde", ] +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + [[package]] name = "itertools" version = "0.10.5" @@ -482,30 +500,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -521,18 +533,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minimal-lexical" @@ -548,7 +551,6 @@ dependencies = [ "arrayvec", "cfg-if", "chrono", - "criterion", "defmt", "doc-comment", "heapless", @@ -571,11 +573,17 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -583,9 +591,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -593,12 +601,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "plotters" version = "0.3.5" @@ -669,9 +671,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -687,9 +689,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -714,9 +716,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -724,9 +726,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -734,9 +736,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -746,9 +748,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -763,9 +765,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -776,37 +778,31 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "serde" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -815,16 +811,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.4.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.1.0", + "indexmap 2.2.3", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -832,14 +829,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -866,49 +863,44 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" -version = "1.0.55" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3de26b0965292219b4287ff031fcba86837900fe9cd2b34ea8ad893c0953d2" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.55" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "time" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -923,10 +915,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -970,9 +963,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -980,24 +973,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1005,28 +998,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -1065,18 +1058,27 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1089,45 +1091,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "yansi" diff --git a/Cargo.toml b/Cargo.toml index 0755222..390e7f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,8 +46,6 @@ approx = "0.5" doc-comment = "0.3" pretty_assertions = "1" quickcheck = { version = "1", default-features = false } -# criterion 0.5.1 requires at least Rust 1.70 because of clap v4.4.0. -criterion = "=0.4" serde_json = "1.0" [features] @@ -181,10 +179,5 @@ required-features = ["all-sentences"] name = "functional_tests" required-features = ["all-sentences"] -[[bench]] -name = "nom_parsing" -harness = false - -[[bench]] -name = "gsv_parser" -harness = false +[workspace] +members = [".", "benches-harness"] \ No newline at end of file diff --git a/benches-harness/Cargo.toml b/benches-harness/Cargo.toml new file mode 100644 index 0000000..5ac2481 --- /dev/null +++ b/benches-harness/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "benches-harness" +version = "0.1.0" +edition = "2021" + +rust-version = "1.70" + +[dev-dependencies] +criterion = { version = "0.5" } +nom = { version = "7.1", default-features = false } +nmea = { path = "../" } + +[[bench]] +name = "nom_parsing" +harness = false + +[[bench]] +name = "gsv_parser" +harness = false \ No newline at end of file diff --git a/benches/gsv_parser.rs b/benches-harness/benches/gsv_parser.rs similarity index 100% rename from benches/gsv_parser.rs rename to benches-harness/benches/gsv_parser.rs diff --git a/benches/nom_parsing.rs b/benches-harness/benches/nom_parsing.rs similarity index 100% rename from benches/nom_parsing.rs rename to benches-harness/benches/nom_parsing.rs diff --git a/benches-harness/src/lib.rs b/benches-harness/src/lib.rs new file mode 100644 index 0000000..804cbe8 --- /dev/null +++ b/benches-harness/src/lib.rs @@ -0,0 +1,2 @@ +//! Dummy crate for testing with [`criterion`]` without bumping MSRV of `nmea` +//! every time there's an MSRV change in dependency crate like [`criterion`].