From 3b9e8046e0ac7645e197aae0e35cc2fbea45ce26 Mon Sep 17 00:00:00 2001 From: Andrew Duffy Date: Tue, 17 Sep 2024 16:26:52 -0400 Subject: [PATCH] Assertion should allow empty compression (#36) The lower-level methods support empty, but this assertion on the wrapper was causing failures when empty plaintext provided --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index b7c8826..fc8b145 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -501,7 +501,7 @@ impl Compressor { // SAFETY: assertion let bytes_written = out_ptr.offset_from(values.as_ptr()); assert!( - bytes_written.is_positive(), + bytes_written >= 0, "out_ptr ended before it started, not possible" );