From 387faa99ed79d0824901fdda10c77a9c5fc48e3d Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Tue, 23 Jun 2020 09:17:39 +0100 Subject: [PATCH] gio: Make the IOStreamAsyncReadWrite constructor private Ensuring this struct can only be created internally is important, ensuring only one reference of GIOStream is tracked. --- src/gio.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gio.rs b/src/gio.rs index 16ce1d8..b75b6b7 100644 --- a/src/gio.rs +++ b/src/gio.rs @@ -72,7 +72,7 @@ unsafe impl> Send for IOStreamAsyncReadWrite {} impl> IOStreamAsyncReadWrite { /// Create a new `gio::IOStream` adapter - pub fn new(stream: T) -> Result, T> { + fn new(stream: T) -> Result, T> { let write = stream .get_output_stream() .and_then(|s| s.dynamic_cast::().ok())