[librsvg: 24/38] get_rust_handle() can now return a &Handle, not a &mut Handle
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 24/38] get_rust_handle() can now return a &Handle, not a &mut Handle
- Date: Fri, 25 Jan 2019 19:39:23 +0000 (UTC)
commit 1468d89a79ac2d7b8af50bf0f468d34bff261097
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Jan 23 12:44:18 2019 -0600
get_rust_handle() can now return a &Handle, not a &mut Handle
rsvg_internals/src/handle.rs | 6 +++---
rsvg_internals/src/pixbuf_utils.rs | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 51cef0c3..f15e5e97 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -663,7 +663,7 @@ impl LoadFlags {
extern "C" {
fn rsvg_handle_get_type() -> glib_sys::GType;
- fn rsvg_handle_get_rust(handle: *const RsvgHandle) -> *mut Handle;
+ fn rsvg_handle_get_rust(handle: *const RsvgHandle) -> *const Handle;
}
#[no_mangle]
@@ -677,8 +677,8 @@ pub unsafe extern "C" fn rsvg_handle_rust_free(raw_handle: *mut Handle) {
Box::from_raw(raw_handle);
}
-pub fn get_rust_handle<'a>(handle: *const RsvgHandle) -> &'a mut Handle {
- unsafe { &mut *(rsvg_handle_get_rust(handle) as *mut Handle) }
+pub fn get_rust_handle<'a>(handle: *const RsvgHandle) -> &'a Handle {
+ unsafe { &*rsvg_handle_get_rust(handle) }
}
#[no_mangle]
diff --git a/rsvg_internals/src/pixbuf_utils.rs b/rsvg_internals/src/pixbuf_utils.rs
index bfdd6dbf..1324fa69 100644
--- a/rsvg_internals/src/pixbuf_utils.rs
+++ b/rsvg_internals/src/pixbuf_utils.rs
@@ -134,7 +134,7 @@ fn get_final_size(dimensions: &RsvgDimensionData, size_mode: &SizeMode) -> (i32,
}
fn render_to_pixbuf_at_size(
- handle: &mut Handle,
+ handle: &Handle,
dimensions: &RsvgDimensionData,
width: i32,
height: i32,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]