I hereby claim:
- I am matejlach on github.
- I am matejlach (https://keybase.io/matejlach) on keybase.
- I have a public key ASDeZ_P8SeBjxLxDy8msngThxsarPrPHpVVoJQhtHQMSIQo
To claim this, I am signing this object:
pcm.mic { | |
type plug | |
slave { | |
pcm "hw:1,0" | |
} | |
} | |
pcm.speakerbonnet { | |
type hw card 0 | |
} |
I hereby claim:
To claim this, I am signing this object:
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+apacheconf+bash+c+cpp+coffeescript+css-extras+dart+erlang+fsharp+git+go+haml+handlebars+haskell+http+jade+java+julia+latex+less+markdown+nasm+perl+php+php-extras+python+r+jsx+rest+ruby+rust+sas+scss+scala+sql+swift+typescript+wiki+yaml&plugins=autolinker+file-highlight+show-language+highlight-keywords */ | |
/** | |
* prism.js default theme for JavaScript, CSS and HTML | |
* Based on dabblet (http://dabblet.com) | |
* @author Lea Verou | |
*/ | |
code[class*="language-"], | |
pre[class*="language-"] { | |
color: black; |
fn main() { | |
struct Date { | |
m: int, | |
y: int | |
} | |
let today = Date {m: 8i, y: 2014i}; | |
println!("\"August\" is the {}th month in {} (and every other year)", today.m, today.y); // access individual fields | |
} |
fn main() { | |
let date = ("Today", 4i, 8i, 2014i); // simple tuple | |
println!("{}", date); | |
let (wd, d, m, y) = ("Today", 4i, 8i, 2014i); // destructuring let | |
println!("{} is {}/{}/{}", wd, d, m, y); // accessing individual variables from the tuple | |
} |
use std::io; | |
fn add(x: int, y: int) -> int { // takes two integers and returns an integer | |
x + y | |
} | |
fn main() { | |
println!("Simple Addition Calculator, written in Rust!"); | |
println!("Enter 1st number: "); |
use std::io; | |
fn main() { | |
println!("Type something:"); | |
let input = io::stdin() | |
.read_line() // read user input | |
.ok().expect("unable to read input!"); // Display this in case of a problem reading user input | |
// convert to &str and get rid of the newline |
static Pi: f64 = 3.14; | |
fn display_pi() { | |
println!("{}", Pi); | |
} | |
fn main() { | |
display_pi() | |
} |
fn main() { | |
// Example of a &str to a String conversion | |
use std::str; | |
let str_slice = "Here is a \"&'static str\""; | |
let str_repl = str::replace(str_slice, "is", "was"); // String replacement | |
println!("{}, now it's a \"String\".", str_repl.to_string()); // String conversion | |
// To go from a String to a &str, use the as_slice() method. | |
} |
fn main() { | |
let x = box 5i; // Creates a box | |
let y = x; // Transfers ownership to "y" | |
let x = &y; // "x" now references what "y" owns | |
println!("{}", x); // This will compile successfully | |
} |