Skip to content

Instantly share code, notes, and snippets.

@Petesta
Created May 15, 2015 15:38
Show Gist options
  • Save Petesta/64b1a6ef44ed973880fe to your computer and use it in GitHub Desktop.
Save Petesta/64b1a6ef44ed973880fe to your computer and use it in GitHub Desktop.
#[derive(Debug)]
struct BPM(u32);
impl BPM {
fn scale(&self, scale: f32) -> BPM {
BPM(0)
}
}
fn main() {
let b = BPM(1);
println!("{:?}", b);
}
@Petesta
Copy link
Author

Petesta commented Nov 13, 2015

fn parseForSound(sound: &String) -> String {
    match sound.as_ref() {
        "kick+snare" => String::from_str("boom click"),
        "kick"       => String::from_str("boom"),
        "snare"      => String::from_str("click"),
        "hihat"      => String::from_str("ting"),
        _            => String::from_str("")
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment