[librsvg: 4/22] handle::acquire_data() - Removed; inline this one-liner into all callers
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 4/22] handle::acquire_data() - Removed; inline this one-liner into all callers
- Date: Tue, 8 Jan 2019 17:53:32 +0000 (UTC)
commit 44e8f5f8bce83a09cd9a909d789cff6a409f2ffe
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jan 7 18:45:16 2019 -0600
handle::acquire_data() - Removed; inline this one-liner into all callers
rsvg_internals/src/handle.rs | 11 ++---------
rsvg_internals/src/xml.rs | 3 ++-
2 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 949444e1..72e51d2d 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -605,13 +605,6 @@ pub struct BinaryData {
pub content_type: Option<String>,
}
-pub fn acquire_data(
- _handle: *mut RsvgHandle,
- aurl: &AllowedUrl,
-) -> Result<BinaryData, LoadingError> {
- io::acquire_data(aurl, None)
-}
-
pub fn acquire_stream(
_handle: *mut RsvgHandle,
aurl: &AllowedUrl,
@@ -628,7 +621,7 @@ pub fn load_image_to_surface(
let aurl = AllowedUrl::from_href(url, get_base_url(handle).as_ref())
.map_err(|_| LoadingError::BadUrl)?;
- let data = acquire_data(handle, &aurl)?;
+ let data = io::acquire_data(&aurl, None)?;
if data.data.len() == 0 {
return Err(LoadingError::EmptyData);
@@ -696,7 +689,7 @@ pub fn load_css(css_styles: &mut CssStyles, handle: *mut RsvgHandle, href_str: &
}
};
- if let Ok(data) = acquire_data(handle, &aurl) {
+ if let Ok(data) = io::acquire_data(&aurl, None) {
let BinaryData {
data: bytes,
content_type,
diff --git a/rsvg_internals/src/xml.rs b/rsvg_internals/src/xml.rs
index a28a4909..1f5069db 100644
--- a/rsvg_internals/src/xml.rs
+++ b/rsvg_internals/src/xml.rs
@@ -14,6 +14,7 @@ use css::{self, CssStyles};
use defs::Defs;
use error::LoadingError;
use handle::{self, RsvgHandle};
+use io;
use node::{node_new, Node, NodeType, RsvgNode};
use property_bag::PropertyBag;
use structure::NodeSvg;
@@ -445,7 +446,7 @@ impl XmlState {
aurl: &AllowedUrl,
encoding: Option<&str>,
) -> Result<(), AcquireError> {
- let binary = handle::acquire_data(self.handle, aurl).map_err(|e| {
+ let binary = io::acquire_data(aurl, None).map_err(|e| {
rsvg_log!("could not acquire \"{}\": {}", aurl.url(), e);
AcquireError::ResourceError
})?;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]