Fix lifetime error in load_font (#47)

* Fix lifetime error in load_font

* Bump minor version
This commit is contained in:
Cobrand
2016-11-06 10:48:39 +08:00
committed by ShuYu Wang
parent a65c2f6026
commit 654264f8f1
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
name = "sdl2_ttf"
description = "SDL2_ttf bindings for Rust"
repository = "https://github.com/andelf/rust-sdl2_ttf"
version = "0.25.0"
version = "0.25.1"
license = "MIT"
readme = "README.md"
authors = ["ShuYu Wang <andelf@gmail.com>"]
+4 -4
View File
@@ -42,8 +42,8 @@ impl Sdl2TtfContext {
/// Loads a font from the given SDL2 rwops object with the given size in
/// points.
pub fn load_font_from_rwops<'a>(&'a self, rwops: RWops<'a>, point_size: u16)
-> Result<Font<'a>, String> {
pub fn load_font_from_rwops<'a,'b>(&'a self, rwops: RWops<'b>, point_size: u16)
-> Result<Font<'b>, String> {
let raw = unsafe {
ffi::TTF_OpenFontRW(rwops.raw(), 0, point_size as c_int)
};
@@ -56,8 +56,8 @@ 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<'a>(&'a self, rwops: RWops<'a>, index: u32,
point_size: u16) -> Result<Font, String> {
pub fn load_font_at_index_from_rwops<'a,'b>(&'a self, rwops: RWops<'b>, index: u32,
point_size: u16) -> Result<Font<'b>, String> {
let raw = unsafe {
ffi::TTF_OpenFontIndexRW(rwops.raw(), 0, point_size as c_int,
index as c_long)