[librsvg: 9/10] Linting changes
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 9/10] Linting changes
- Date: Tue, 7 Dec 2021 19:37:30 +0000 (UTC)
commit b6757fea64334df998e1bd62be4f32909819dd4f
Merge: 66fffab3 338f88a4
Author: Daniel Petri Rocha <daniel petri tum de>
Date: Mon Nov 22 23:07:47 2021 +0100
Linting changes
Cargo.lock | 18 ++++++++++++++++++
src/length.rs | 4 ++--
tests/src/cmdline/rsvg_convert.rs | 23 ++++++++++-------------
tests/src/predicates/file.rs | 2 +-
4 files changed, 31 insertions(+), 16 deletions(-)
---
diff --cc Cargo.lock
index 54cc110e,54cc110e..cff2e00a
--- a/Cargo.lock
+++ b/Cargo.lock
@@@ -878,6 -878,6 +878,7 @@@ dependencies =
"itertools 0.9.0",
"language-tags",
"libc",
++ "libxml",
"locale_config",
"lopdf",
"markup5ever",
@@@ -905,6 -905,6 +906,17 @@@
"yeslogic-fontconfig-sys",
]
++[[package]]
++name = "libxml"
++version = "0.3.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "02c07ecb409949e5c5c0818e189e6bc766bcb8b08b3401772ca8c61a58c682b8"
++dependencies = [
++ "libc",
++ "pkg-config",
++ "vcpkg",
++]
++
[[package]]
name = "linked-hash-map"
version = "0.5.4"
@@@ -2312,6 -2312,6 +2324,12 @@@ version = "0.7.6
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
++[[package]]
++name = "vcpkg"
++version = "0.2.15"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
++
[[package]]
name = "vec_map"
version = "0.8.2"
diff --cc src/length.rs
index 0d16b472,4e7d5194..13b9ae74
--- a/src/length.rs
+++ b/src/length.rs
@@@ -44,8 -44,8 +44,8 @@@
use cssparser::{match_ignore_ascii_case, Parser, Token, _cssparser_internal_to_lowercase};
use std::f64::consts::*;
--use std::marker::PhantomData;
use std::fmt;
++use std::marker::PhantomData;
use crate::dpi::Dpi;
use crate::drawing_ctx::ViewParams;
@@@ -513,9 -513,9 +513,9 @@@ impl<N: Normalize> Parse for LengthOrAu
}
impl fmt::Display for LengthUnit {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let unit = match &self {
-- LengthUnit::Percent => "%",
++ LengthUnit::Percent => "%",
LengthUnit::Px => "px",
LengthUnit::Em => "em",
LengthUnit::Ex => "ex",
diff --cc tests/src/cmdline/rsvg_convert.rs
index a1ad58cc,a1ad58cc..b3fab3b4
--- a/tests/src/cmdline/rsvg_convert.rs
+++ b/tests/src/cmdline/rsvg_convert.rs
@@@ -10,13 -10,13 +10,13 @@@ use assert_cmd::assert::IntoOutputPredi
use assert_cmd::Command;
#[cfg(system_deps_have_cairo_pdf)]
use chrono::{TimeZone, Utc};
++use librsvg::{Length, LengthUnit};
use predicates::boolean::*;
use predicates::prelude::*;
use predicates::str::*;
use std::path::Path;
use tempfile::Builder;
use url::Url;
--use librsvg::{Length, LengthUnit};
// What should be tested here?
// The goal is to test the code in rsvg-convert, not the entire library.
@@@ -169,10 -169,10 +169,9 @@@ fn user_specified_width_and_height()
.assert()
.success()
.stdout(file::is_svg().with_size(
-- Length::new(42.0, LengthUnit::Cm),
-- Length::new(43.0, LengthUnit::Cm)
-- )
-- );
++ Length::new(42.0, LengthUnit::Cm),
++ Length::new(43.0, LengthUnit::Cm),
++ ));
}
#[cfg(system_deps_have_cairo_svg)]
@@@ -188,10 -188,10 +187,9 @@@ fn user_specified_width_and_height_px_o
.assert()
.success()
.stdout(file::is_svg().with_size(
-- Length::new(1920.0, LengthUnit::Px),
-- Length::new(1920.0, LengthUnit::Px)
-- )
-- );
++ Length::new(1920.0, LengthUnit::Px),
++ Length::new(1920.0, LengthUnit::Px),
++ ));
}
#[cfg(system_deps_have_cairo_svg)]
@@@ -215,10 -215,10 +213,9 @@@ fn user_specified_width_and_height_a4(
.assert()
.success()
.stdout(file::is_svg().with_size(
-- Length::new(210.0, LengthUnit::Mm),
-- Length::new(297.0, LengthUnit::Mm)
-- )
-- );
++ Length::new(210.0, LengthUnit::Mm),
++ Length::new(297.0, LengthUnit::Mm),
++ ));
}
#[test]
diff --cc tests/src/predicates/file.rs
index 244835e0,244835e0..997b3690
--- a/tests/src/predicates/file.rs
+++ b/tests/src/predicates/file.rs
@@@ -1,5 -1,5 +1,5 @@@
use predicates::prelude::*;
--use predicates::str::{StartsWithPredicate};
++use predicates::str::StartsWithPredicate;
use crate::predicates::pdf::PdfPredicate;
use crate::predicates::png::PngPredicate;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]