From 257e99dbcaa97519e8a6d50431712cf9bafe45c9 Mon Sep 17 00:00:00 2001 From: "Brian J. Burg" Date: Fri, 16 Nov 2012 11:58:24 -0800 Subject: [PATCH] Move IOSurface static methods outside of trait/impl. --- io_surface.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/io_surface.rs b/io_surface.rs index b110d27..1a9d658 100644 --- a/io_surface.rs +++ b/io_surface.rs @@ -23,23 +23,20 @@ pub type IOSurface = CFWrapper; pub type IOSurfaceID = u32; pub trait IOSurfaceMethods { - static fn new_io_surface(properties: &UntypedCFDictionary) -> IOSurface; - static fn lookup(csid: IOSurfaceID) -> IOSurface; - fn get_id(&self) -> IOSurfaceID; } +pub fn new(properties: &UntypedCFDictionary) -> IOSurface { + let result = IOSurfaceCreate(*properties.borrow_ref()); + CFWrapper::wrap_owned(result) +} + +pub fn lookup(csid: IOSurfaceID) -> IOSurface { + let result = IOSurfaceLookup(csid); + CFWrapper::wrap_owned(result) +} + pub impl IOSurface : IOSurfaceMethods { - static fn new_io_surface(properties: &UntypedCFDictionary) -> IOSurface { - let result = IOSurfaceCreate(*properties.borrow_ref()); - CFWrapper::wrap_owned(result) - } - - static fn lookup(csid: IOSurfaceID) -> IOSurface { - let result = IOSurfaceLookup(csid); - CFWrapper::wrap_owned(result) - } - fn get_id(&self) -> IOSurfaceID { IOSurfaceGetID(self.obj) }