[librsvg: 1/3] rsvg-convert - upcast all streams to InputStream / OutputStream
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/3] rsvg-convert - upcast all streams to InputStream / OutputStream
- Date: Fri, 26 Mar 2021 23:14:39 +0000 (UTC)
commit 36aca7d6142a8eb9ed54323cca93c916d4c5194b
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Mar 23 16:22:53 2021 -0600
rsvg-convert - upcast all streams to InputStream / OutputStream
src/bin/rsvg-convert.rs | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index 04b70815..4fcf30c6 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -326,16 +326,18 @@ mod metadata {
struct Stdin;
impl Stdin {
- pub fn stream() -> UnixInputStream {
- unsafe { UnixInputStream::new(0) }
+ pub fn stream() -> InputStream {
+ let stream = unsafe { UnixInputStream::new(0) };
+ stream.upcast::<InputStream>()
}
}
struct Stdout;
impl Stdout {
- pub fn stream() -> UnixOutputStream {
- unsafe { UnixOutputStream::new(1) }
+ pub fn stream() -> OutputStream {
+ let stream = unsafe { UnixOutputStream::new(1) };
+ stream.upcast::<OutputStream>()
}
}
@@ -411,7 +413,7 @@ impl Converter {
for input in &self.input {
let (stream, basefile) = match input {
- Input::Stdin => (Stdin::stream().upcast::<InputStream>(), None),
+ Input::Stdin => (Stdin::stream(), None),
Input::Named(p) => {
let file = p.get_gfile();
let stream = file
@@ -513,7 +515,7 @@ impl Converter {
fn create_surface(&self, size: Size) -> Result<Surface, Error> {
let output_stream = match self.output {
- Output::Stdout => Stdout::stream().upcast::<OutputStream>(),
+ Output::Stdout => Stdout::stream(),
Output::Path(ref p) => {
let file = gio::File::new_for_path(p);
let stream = file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]