Skip to content

Instantly share code, notes, and snippets.

@ScatteredRay
Created April 24, 2013 03:55
Show Gist options
  • Save ScatteredRay/5449498 to your computer and use it in GitHub Desktop.
Save ScatteredRay/5449498 to your computer and use it in GitHub Desktop.
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 }
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) {
}
}
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