[librsvg] Handle.close() - use read_stream_sync() instead of duplicating that code



commit 8ade27af875230f050e5e7fd343fcbb5ea0b77c7
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Mar 5 17:13:39 2019 -0600

    Handle.close() - use read_stream_sync() instead of duplicating that code

 rsvg_internals/src/handle.rs | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 1ac37cb7..cfa158a8 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -275,15 +275,7 @@ impl Handle {
                 let bytes = Bytes::from(&*buffer);
                 let stream = gio::MemoryInputStream::new_from_bytes(&bytes);
 
-                let svg = Svg::load_from_stream(&self.load_options(), &stream.upcast(), None)
-                    .map_err(|e| {
-                        self.load_state.set(LoadState::ClosedError);
-                        e
-                    })?;
-
-                self.load_state.set(LoadState::ClosedOk);
-                *self.svg.borrow_mut() = Some(Rc::new(svg));
-                Ok(())
+                self.read_stream_sync(&stream.upcast(), None)
             }
 
             LoadState::ClosedOk | LoadState::ClosedError => {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]