From d76b77fbf180b5e9c6b354e00347cc71aa82c0f5 Mon Sep 17 00:00:00 2001 From: Avril Date: Fri, 20 Aug 2021 21:29:46 +0100 Subject: [PATCH] Fixed build fail with async feature. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for chacha20stream's current commit: Small curse − 小凶 --- Cargo.toml | 2 +- src/stream_async/sink.rs | 4 +--- src/stream_async/source.rs | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fb23873..ddf5b08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chacha20stream" -version = "2.2.0" +version = "2.2.1" keywords = ["chacha20_poly1305", "stream", "wrapper", "encryption", "decryption"] description = "A writable wrapper stream for encryption and decryption with the stream cipher chacha20_poly1305" homepage = "https://git.flanchan.moe/flanchan/chacha20stream" diff --git a/src/stream_async/sink.rs b/src/stream_async/sink.rs index e77de16..6011141 100644 --- a/src/stream_async/sink.rs +++ b/src/stream_async/sink.rs @@ -114,9 +114,7 @@ impl Sink /// The counterpart to `into_parts()`. #[inline] pub fn from_parts(stream: W, crypter: Crypter) -> Self { - Self { - stream, crypter - } + Self::new(stream, crypter) } /// The crypter of this instance diff --git a/src/stream_async/source.rs b/src/stream_async/source.rs index fe4cd72..3bd952c 100644 --- a/src/stream_async/source.rs +++ b/src/stream_async/source.rs @@ -79,9 +79,7 @@ impl Source /// The counterpart to `into_parts()`. #[inline] pub fn from_parts(stream: R, crypter: Crypter) -> Self { - Self { - stream, crypter - } + Self::new(stream, crypter) }