From 970ee3cd024f8b02cc40f461fe6b2b9acdbdcffc Mon Sep 17 00:00:00 2001 From: Cobrand Date: Fri, 27 May 2016 09:20:15 +0200 Subject: [PATCH] load_font now borrow rwops instead of consuming it --- src/sdl2_ttf/context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdl2_ttf/context.rs b/src/sdl2_ttf/context.rs index 163379f6..d4ecad6c 100644 --- a/src/sdl2_ttf/context.rs +++ b/src/sdl2_ttf/context.rs @@ -42,7 +42,7 @@ impl Sdl2TtfContext { /// Loads a font from the given SDL2 rwops object with the given size in /// points. - pub fn load_font_from_rwops(&self, rwops: RWops, point_size: u16) + pub fn load_font_from_rwops(&self, rwops: &RWops, point_size: u16) -> Result { let raw = unsafe { ffi::TTF_OpenFontRW(rwops.raw(), 0, point_size as c_int) @@ -56,7 +56,7 @@ impl Sdl2TtfContext { /// Loads the font at the given index of the SDL2 rwops object with /// the given size in points. - pub fn load_font_at_index_from_rwops(&self, rwops: RWops, index: u32, + pub fn load_font_at_index_from_rwops(&self, rwops: &RWops, index: u32, point_size: u16) -> Result { let raw = unsafe { ffi::TTF_OpenFontIndexRW(rwops.raw(), 0, point_size as c_int,