Skip to content

Instantly share code, notes, and snippets.

@maretekent
Created January 15, 2018 18:21
Show Gist options
  • Save maretekent/0d9febff912f38b07285f5ed4b83e382 to your computer and use it in GitHub Desktop.
Save maretekent/0d9febff912f38b07285f5ed4b83e382 to your computer and use it in GitHub Desktop.
#[allow(non_snake_case)]
mod myMod {
#[allow(dead_code)]
pub struct Mammals<T>{
pub somedata: T,
}
impl<T> Mammals<T> {
pub fn new(somedata: T) -> Mammals<T> {
Mammals {
somedata: somedata,
}
}
}
}
fn main(){
let _cat = myMod::Mammals::new("My first Mammal is created...");
println!("Our new action: {}", _cat.somedata);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment