[librsvg: 3/5] Derive a Default impl for Loader and use it from Loader::new()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 3/5] Derive a Default impl for Loader and use it from Loader::new()
- Date: Tue, 25 Aug 2020 17:35:28 +0000 (UTC)
commit b10eba9010e0eff6b9ef0f692dd0a81eba8c8bf8
Author: Sven Neumann <sven svenfoo org>
Date: Tue Aug 25 08:17:54 2020 +0200
Derive a Default impl for Loader and use it from Loader::new()
See https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
librsvg_crate/src/lib.rs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/librsvg_crate/src/lib.rs b/librsvg_crate/src/lib.rs
index d66f75fb..70f21efd 100644
--- a/librsvg_crate/src/lib.rs
+++ b/librsvg_crate/src/lib.rs
@@ -174,6 +174,7 @@ pub use rsvg_internals::{
/// functions to load an [`SvgHandle`][SvgHandle].
///
/// [SvgHandle]: struct.SvgHandle.html
+#[derive(Default)]
pub struct Loader {
unlimited_size: bool,
keep_image_data: bool,
@@ -200,10 +201,7 @@ impl Loader {
/// .unwrap();
/// ```
pub fn new() -> Self {
- Loader {
- unlimited_size: false,
- keep_image_data: false,
- }
+ Self::default()
}
/// Controls safety limits used in the XML parser.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]