[librsvg/rustify-rsvg-convert: 7/9] rsvg-convert: fix clippy warnings
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustify-rsvg-convert: 7/9] rsvg-convert: fix clippy warnings
- Date: Sun, 17 Jan 2021 17:58:01 +0000 (UTC)
commit fad5c41026108ebfd615a0d338007df79cc8dea1
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Jan 17 14:29:35 2021 +0100
rsvg-convert: fix clippy warnings
src/bin/rsvg-convert.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index bd64f5d5..929be141 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -380,7 +380,7 @@ impl Converter {
// Create the surface once on the first input
surface.get_or_init(|| self.create_surface(&renderer, input));
- surface.get().map(|s| {
+ if let Some(s) = surface.get() {
s.render(
&renderer,
self.zoom,
@@ -388,13 +388,13 @@ impl Converter {
self.export_id.as_deref(),
)
.unwrap_or_else(|e| exit!("Error rendering SVG {}: {}", input, e))
- });
+ };
}
- surface.take().map(|s| {
+ if let Some(s) = surface.take() {
s.finish()
.unwrap_or_else(|e| exit!("Error saving output: {}", e))
- });
+ };
}
fn create_surface(&self, renderer: &CairoRenderer, input: &Input) -> Surface {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]