Permalink
Browse files

Move FTErrorMethods to rust-freetype.

  • Loading branch information...
Brian J. Burg
Brian J. Burg committed Nov 14, 2012
1 parent bb258ad commit 351d5a3398f088c39d5aec28760d185237a32c66
Showing with 9 additions and 0 deletions.
  1. +9 −0 freetype.rs
View
@@ -180,6 +180,15 @@ type FT_F2Dot14 = c_short;
type FT_F26Dot6 = c_long;
type FT_Fixed = c_long;
type FT_Error = c_int;
+
+pub trait FTErrorMethods {
+ fn succeeded() -> bool;
+}
+
+pub impl FT_Error : FTErrorMethods {
+ fn succeeded() -> bool { self == 0 as FT_Error }
+}
+
type FT_Pointer = *c_void;
type FT_Offset = size_t;
type FT_PtrDist = ptrdiff_t;

0 comments on commit 351d5a3

Please sign in to comment.