From 1222b4bacfcee3d765f573725f96d7d8b08886e2 Mon Sep 17 00:00:00 2001 From: Charles Lanahan Date: Fri, 20 Oct 2023 22:05:05 -0400 Subject: [PATCH 1/2] Removed all the dead code. --- Cargo.toml | 2 +- src/core/bexter.rs | 12 ------------ src/core/common.rs | 20 -------------------- src/core/prefixer.rs | 4 ---- src/core/salter.rs | 14 -------------- src/core/serder.rs | 10 ---------- src/lib.rs | 3 +-- 7 files changed, 2 insertions(+), 63 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ebbed03..73c3822 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cesride" -version = "0.6.2" +version = "0.6.3" edition = "2021" description = "Cryptographic primitives for use with Composable Event Streaming Representation (CESR)" license = "Apache-2.0" diff --git a/src/core/bexter.rs b/src/core/bexter.rs index c6604bc..13fb10b 100644 --- a/src/core/bexter.rs +++ b/src/core/bexter.rs @@ -311,16 +311,4 @@ mod test { assert_eq!(bexter.qb2().unwrap(), qb2); assert_eq!(bexter.bext().unwrap(), bext); } - - fn unhappy() { - assert!(Bexter::new( - None, - None, - None, - None, - Some("DKxy2sgzfplyr-tgwIxS19f2OchFHtLwPWD3v4oYimBx"), - None - ) - .is_err()); - } } diff --git a/src/core/common.rs b/src/core/common.rs index b62d525..5a688bf 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -102,26 +102,6 @@ pub mod Ids { const REVER_STRING: &str = "(?P[A-Z]{4})(?P[0-9a-f])(?P[0-9a-f])(?P[A-Z]{4})(?P[0-9a-f]{6})_"; const IDENTS: &[&str] = &[Identage::ACDC, Identage::KERI]; const SERIALS: &[&str] = &[Serialage::JSON]; -const ILKS: &[&str] = &[ - Ilkage::icp, - Ilkage::rot, - Ilkage::ixn, - Ilkage::dip, - Ilkage::drt, - Ilkage::rct, - Ilkage::ksn, - Ilkage::qry, - Ilkage::rpy, - Ilkage::exn, - Ilkage::pro, - Ilkage::bar, - Ilkage::vcp, - Ilkage::vrt, - Ilkage::iss, - Ilkage::rev, - Ilkage::bis, - Ilkage::brv, -]; pub(crate) const DUMMY: u8 = b'#'; diff --git a/src/core/prefixer.rs b/src/core/prefixer.rs index 0f1ba4d..0c6a95a 100644 --- a/src/core/prefixer.rs +++ b/src/core/prefixer.rs @@ -448,10 +448,6 @@ mod test { assert!(result); } - fn build_verfer(code: &str, raw: &[u8]) -> Verfer { - Verfer::new(Some(code), Some(raw), None, None, None).unwrap() - } - #[rstest] #[case( None, diff --git a/src/core/salter.rs b/src/core/salter.rs index ec4f214..5ccd084 100644 --- a/src/core/salter.rs +++ b/src/core/salter.rs @@ -281,12 +281,6 @@ mod test { } impl Seal { - pub fn new(i: &str, s: &str, d: &str, last: Option) -> Self { - let last = last.unwrap_or(false); - - Self { i: i.to_string(), s: s.to_string(), d: d.to_string(), last } - } - pub fn i(&self) -> String { self.i.clone() } @@ -370,14 +364,6 @@ mod test { Ok(Vault { current, next }) } - - pub fn current(&self) -> Vec { - self.current.clone() - } - - pub fn next(&self) -> Vec { - self.next.clone() - } } fn messagize( diff --git a/src/core/serder.rs b/src/core/serder.rs index 502a5e4..8286e72 100644 --- a/src/core/serder.rs +++ b/src/core/serder.rs @@ -568,16 +568,6 @@ pub(crate) mod test { assert!(Serder::new(None, None, None, Some(&ked), None).is_err()); } - pub(crate) mod traiter { - #[allow(non_upper_case_globals)] - #[allow(non_snake_case)] - mod Codex { - const EstOnly: &str = "EO"; - const DoNotDelegate: &str = "DND"; - const NoBackeds: &str = "NB"; - } - } - // what follows is a simple inception function. it is used above to verify serder functionality. // this function uses convenience methods unlike most test code. it is likely that it will diff --git a/src/lib.rs b/src/lib.rs index 0fd4041..876c169 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ -// TODO: remove before 1.0.0 -#![allow(dead_code)] +#![deny(warnings)] #[macro_use] pub mod data; From d9c926aff8287ddd241cc2d956f1d396cbf1e219 Mon Sep 17 00:00:00 2001 From: Charles Lanahan Date: Mon, 23 Oct 2023 09:46:29 -0400 Subject: [PATCH 2/2] Added back unhappy test and notated it as a test per PR change request --- src/core/bexter.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/core/bexter.rs b/src/core/bexter.rs index 13fb10b..1d20549 100644 --- a/src/core/bexter.rs +++ b/src/core/bexter.rs @@ -311,4 +311,17 @@ mod test { assert_eq!(bexter.qb2().unwrap(), qb2); assert_eq!(bexter.bext().unwrap(), bext); } + + #[rstest] + fn unhappy() { + assert!(Bexter::new( + None, + None, + None, + None, + Some("DKxy2sgzfplyr-tgwIxS19f2OchFHtLwPWD3v4oYimBx"), + None + ) + .is_err()); + } }