[librsvg: 24/32] Use ok_or_else like clippy says
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 24/32] Use ok_or_else like clippy says
- Date: Fri, 4 Dec 2020 21:11:32 +0000 (UTC)
commit 172f339acac8943c5809cecb756e5bb62b665e46
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Nov 30 12:42:35 2020 -0600
Use ok_or_else like clippy says
src/c_api/pixbuf_utils.rs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/c_api/pixbuf_utils.rs b/src/c_api/pixbuf_utils.rs
index 4d9b30a1..73433a74 100644
--- a/src/c_api/pixbuf_utils.rs
+++ b/src/c_api/pixbuf_utils.rs
@@ -23,9 +23,8 @@ use crate::{
fn pixbuf_new(width: i32, height: i32) -> Result<Pixbuf, RenderingError> {
assert!(width > 0 && height > 0);
- Pixbuf::new(Colorspace::Rgb, true, 8, width, height).ok_or(RenderingError::OutOfMemory(
- String::from("creating a Pixbuf"),
- ))
+ Pixbuf::new(Colorspace::Rgb, true, 8, width, height)
+ .ok_or_else(|| RenderingError::OutOfMemory(String::from("creating a Pixbuf")))
}
pub fn empty_pixbuf() -> Result<Pixbuf, RenderingError> {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]