Created
April 24, 2013 03:55
-
-
Save ScatteredRay/5449498 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render.rs:5:2: 6:1 error: type `gldevice::GLDevice` does not implement any method in scope named `init` | |
render.rs:5 device.init() | |
render.rs:6 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait Device { | |
pub fn init(&self); | |
} | |
pub struct GLDevice; | |
impl GLDevice { | |
pub fn new() -> GLDevice { | |
GLDevice | |
} | |
} | |
impl Device for GLDevice { | |
pub fn init(&self) { | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod gldevice; | |
fn init() { | |
let device = gldevice::GLDevice::new(); | |
device.init() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment