[librsvg: 1/3] allowed_url: rename PlainUri to PlainUrl for consistency
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/3] allowed_url: rename PlainUri to PlainUrl for consistency
- Date: Mon, 14 Jan 2019 23:47:28 +0000 (UTC)
commit 3996ca31ce41fa007fdd0296b37639f7901369e1
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Jan 14 21:13:41 2019 +0100
allowed_url: rename PlainUri to PlainUrl for consistency
rsvg_internals/src/allowed_url.rs | 12 ++++++------
rsvg_internals/src/filters/image.rs | 4 ++--
rsvg_internals/src/image.rs | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/rsvg_internals/src/allowed_url.rs b/rsvg_internals/src/allowed_url.rs
index 525185d4..561b0b80 100644
--- a/rsvg_internals/src/allowed_url.rs
+++ b/rsvg_internals/src/allowed_url.rs
@@ -161,7 +161,7 @@ fn canonicalize<P: AsRef<Path>>(path: P) -> Result<PathBuf, io::Error> {
/// processed. This enum makes that distinction.
#[derive(Debug, PartialEq)]
pub enum Href {
- PlainUri(String),
+ PlainUrl(String),
WithFragment(Fragment),
}
@@ -225,7 +225,7 @@ impl Href {
(None, Some(f)) if f.len() == 0 => Err(HrefError::ParseError),
(None, Some(f)) => Ok(Href::WithFragment(Fragment(None, f.to_string()))),
(Some(u), _) if u.len() == 0 => Err(HrefError::ParseError),
- (Some(u), None) => Ok(Href::PlainUri(u.to_string())),
+ (Some(u), None) => Ok(Href::PlainUrl(u.to_string())),
(Some(_u), Some(f)) if f.len() == 0 => Err(HrefError::ParseError),
(Some(u), Some(f)) => Ok(Href::WithFragment(Fragment(
Some(u.to_string()),
@@ -239,7 +239,7 @@ impl Href {
use self::Href::*;
match Href::parse(href)? {
- r @ PlainUri(_) => Ok(r),
+ r @ PlainUrl(_) => Ok(r),
WithFragment(_) => Err(HrefError::FragmentForbidden),
}
}
@@ -248,7 +248,7 @@ impl Href {
use self::Href::*;
match Href::parse(href)? {
- PlainUri(_) => Err(HrefError::FragmentRequired),
+ PlainUrl(_) => Err(HrefError::FragmentRequired),
r @ WithFragment(_) => Ok(r),
}
}
@@ -362,7 +362,7 @@ mod tests {
fn parses_href() {
assert_eq!(
Href::parse("uri").unwrap(),
- Href::PlainUri("uri".to_string())
+ Href::PlainUrl("uri".to_string())
);
assert_eq!(
Href::parse("#fragment").unwrap(),
@@ -385,7 +385,7 @@ mod tests {
fn href_without_fragment() {
assert_eq!(
Href::without_fragment("uri").unwrap(),
- Href::PlainUri("uri".to_string())
+ Href::PlainUrl("uri".to_string())
);
assert_eq!(
diff --git a/rsvg_internals/src/filters/image.rs b/rsvg_internals/src/filters/image.rs
index f42a1cb0..bd8fd21b 100644
--- a/rsvg_internals/src/filters/image.rs
+++ b/rsvg_internals/src/filters/image.rs
@@ -119,7 +119,7 @@ impl Image {
bounds_builder: BoundsBuilder<'_>,
href: &Href,
) -> Result<ImageSurface, FilterError> {
- let url = if let Href::PlainUri(ref url) = *href {
+ let url = if let Href::PlainUrl(ref url) = *href {
url
} else {
unreachable!();
@@ -219,7 +219,7 @@ impl Filter for Image {
if let Some(href) = href_opt {
let output_surface = match *href {
- Href::PlainUri(_) => {
+ Href::PlainUrl(_) => {
self.render_external_image(ctx, draw_ctx, bounds_builder, href)?
}
Href::WithFragment(ref frag) => self.render_node(ctx, draw_ctx, bounds, frag)?,
diff --git a/rsvg_internals/src/image.rs b/rsvg_internals/src/image.rs
index 6a60dc6d..11bfb32c 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -81,7 +81,7 @@ impl NodeTrait for NodeImage {
fn resolve_resources(&self, load_options: &LoadOptions) -> NodeResult {
match *self.href.borrow() {
None => (),
- Some(Href::PlainUri(ref url)) => {
+ Some(Href::PlainUrl(ref url)) => {
*self.surface.borrow_mut() = Some(
// FIXME: translate the error better here
handle::load_image_to_surface(load_options, &url).map_err(|e| {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]