[librsvg: 3/13] Remove redundant closures
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 3/13] Remove redundant closures
- Date: Wed, 26 Aug 2020 17:30:41 +0000 (UTC)
commit e9ba989419f308fec9c96eb44b85d0a77aff3fcf
Author: Sven Neumann <sven svenfoo org>
Date: Tue Aug 25 15:17:00 2020 +0200
Remove redundant closures
See https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
librsvg/c_api.rs | 4 ++--
librsvg/pixbuf_utils.rs | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/librsvg/c_api.rs b/librsvg/c_api.rs
index ffe6a209..2923c351 100644
--- a/librsvg/c_api.rs
+++ b/librsvg/c_api.rs
@@ -189,7 +189,7 @@ impl BaseUrl {
self.inner
.as_ref()
.map(|b| b.cstring.as_ptr())
- .unwrap_or_else(|| ptr::null())
+ .unwrap_or_else(ptr::null)
}
}
@@ -1496,7 +1496,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_from_gfile_sync(
let res = file
.read(cancellable.as_ref())
- .map_err(|e| LoadingError::from(e))
+ .map_err(LoadingError::from)
.and_then(|stream| rhandle.read_stream_sync(&stream.upcast(), cancellable.as_ref()));
match res {
diff --git a/librsvg/pixbuf_utils.rs b/librsvg/pixbuf_utils.rs
index d9f181c8..057dbee0 100644
--- a/librsvg/pixbuf_utils.rs
+++ b/librsvg/pixbuf_utils.rs
@@ -234,7 +234,7 @@ fn pixbuf_from_file_with_size_mode(
let cancellable: Option<&gio::Cancellable> = None;
let handle = match file
.read(cancellable)
- .map_err(|e| LoadingError::from(e))
+ .map_err(LoadingError::from)
.and_then(|stream| Handle::from_stream(&load_options, stream.as_ref(), None))
{
Ok(handle) => handle,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]