gio: Make the IOStreamAsyncReadWrite constructor private

Ensuring this struct can only be created internally is important, ensuring
only one reference of GIOStream is tracked.
pull/38/head
Philippe Normand 5 years ago committed by Sebastian Dröge
parent be83431c2f
commit 220df7b0af
  1. 2
      src/gio.rs

@ -73,7 +73,7 @@ unsafe impl<T: IsA<gio::IOStream>> Send for IOStreamAsyncReadWrite<T> {}
impl<T: IsA<gio::IOStream>> IOStreamAsyncReadWrite<T> {
/// Create a new `gio::IOStream` adapter
pub fn new(stream: T) -> Result<IOStreamAsyncReadWrite<T>, T> {
fn new(stream: T) -> Result<IOStreamAsyncReadWrite<T>, T> {
let write = stream
.get_output_stream()
.and_then(|s| s.dynamic_cast::<gio::PollableOutputStream>().ok())

Loading…
Cancel
Save