diff --git a/crates/trees/src/cascading/mod.rs b/crates/trees/src/cascading/mod.rs index 9e36f4f..5852624 100644 --- a/crates/trees/src/cascading/mod.rs +++ b/crates/trees/src/cascading/mod.rs @@ -405,7 +405,7 @@ where for subtree_power in first_subtree_power..=last_subtree_power { // We have a special case for subtree_power = 0 // because the subtree is completely empty. - // This represents the very borrow left of the tree. + // This represents the very bottom left of the tree. // parent_index represents the index of the parent node of the subtree. // It is the power of two on the left most branch of the tree. let parent_index = if subtree_power == 0 { diff --git a/examples/abort/main.rs b/examples/abort/main.rs index a8e2c56..09317b2 100644 --- a/examples/abort/main.rs +++ b/examples/abort/main.rs @@ -19,7 +19,9 @@ static INITIAL_LEAVES: usize = 10; /// is successful /// /// Run this binary with no arguments to run the tests -fn main() -> Result<()> { +/// `RUSTFLAGS="-C panic=abort" cargo run --example abort` +#[tokio::main] +async fn main() -> Result<()> { let args: Vec = env::args().collect(); // initialize @@ -63,9 +65,7 @@ fn run_test(prefix: &str) -> Result { let stdout = String::from_utf8(output.stdout)?; print!("{}", stdout); let stderr = String::from_utf8(output.stderr)?; - if !stderr.is_empty() { - panic!("{}", stderr); - } + print!("{}", stderr); let output = std::process::Command::new(BIN_PATH) .arg(format!("{prefix}_restore")) @@ -97,7 +97,7 @@ fn cascade_init() -> Result<()> { &leaves, ); - let _handle = std::thread::spawn(move || { + let _handle = tokio::spawn(async move { for _ in 0..15 { tree.push(U256::from(2)).unwrap(); } @@ -107,7 +107,7 @@ fn cascade_init() -> Result<()> { let millis: u64 = rng.gen_range(0..50); std::thread::sleep(std::time::Duration::from_millis(millis)); - Ok(()) + panic!(""); } fn cascade_restore() -> Result<()> { @@ -145,7 +145,7 @@ fn lazy_init() -> Result<()> { let millis: u64 = rng.gen_range(0..50); std::thread::sleep(std::time::Duration::from_millis(millis)); - Ok(()) + panic!(""); } fn lazy_restore() -> Result<()> { diff --git a/src/util.rs b/src/util.rs index 8078aa5..46afc6c 100644 --- a/src/util.rs +++ b/src/util.rs @@ -69,7 +69,7 @@ pub(crate) fn deserialize_bytes<'de, const N: usize, D: Deserializer<'de>>( ) -> Result<[u8; N], D::Error> { if deserializer.is_human_readable() { struct StrVisitor; - impl<'de, const N: usize> Visitor<'de> for StrVisitor { + impl Visitor<'_> for StrVisitor { type Value = [u8; N]; fn expecting(&self, formatter: &mut Formatter) -> FmtResult { @@ -86,7 +86,7 @@ pub(crate) fn deserialize_bytes<'de, const N: usize, D: Deserializer<'de>>( deserializer.deserialize_str(StrVisitor) } else { struct ByteVisitor; - impl<'de, const N: usize> Visitor<'de> for ByteVisitor { + impl Visitor<'_> for ByteVisitor { type Value = [u8; N]; fn expecting(&self, formatter: &mut Formatter) -> FmtResult {