This file contains hidden or 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
extern crate rand; | |
use std::io; | |
use std::num; | |
use std::io::BufferedReader; | |
use rand::{task_rng, Rng}; | |
fn main() -> () { |
This file contains hidden or 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
use _macros; | |
mod foo { | |
pub trait Foo { | |
fn hello(&self); | |
} | |
} | |
mod bar { | |
pub trait Foo { |
This file contains hidden or 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
doug:rust-libs doug$ cat junk.rs | |
#![crate_id = "junk#0.1"] | |
use std::libc::c_int; | |
#[no_mangle] | |
pub extern fn dothing(a: c_int, b:c_int) -> c_int { | |
return a + b; | |
} |
This file contains hidden or 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
define(["require", "exports", 'jquery'], function(require, exports, $) { | |
requirejs.config({ baseUrl: "Scripts", paths: { jquery: "jquery-1.10.2" } }); // <--- Never gets used | |
$('#hello').click(); // <--- Won't work, because jquery won't be resolve to the right path | |
}); |
This file contains hidden or 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
enum PyrsErr { | |
InternalErr | |
} | |
... | |
pub fn init() -> Result<*mut Struct_ppyData, PyrsErr> { | |
unsafe { | |
return Ok(ppy_init()); | |
} |
This file contains hidden or 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
macro_rules! trace( | |
($($arg:tt)*) => ( | |
{ let x = ::std::io::stdout().write_line(format_args!(::std::fmt::format, $($arg)*)); println!("{}", x); } | |
); | |
) | |
pub fn do_something() -> uint { | |
return 99; | |
} |
This file contains hidden or 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
extern crate libc; | |
use libc::c_void; | |
use std::ops::Drop; | |
use std::intrinsics::forget; | |
use std::ptr::swap; | |
struct Foo { x: int } | |
impl Drop for Foo { |
This file contains hidden or 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
use std::iter::Iterator; | |
struct Foo { | |
offset:uint, | |
x:[int, ..8] | |
} | |
impl Iterator<(* mut Foo, int)> for Foo { | |
fn next(& mut self) -> Option<(* mut Foo, int)> { | |
if self.offset > 0 { |
This file contains hidden or 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
// ---- | |
// Sass (v3.3.5) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
$mqsupport: true; | |
$static-bp: tablet; | |
$breakpoints: ( | |
mobile: (false, 100), | |
tablet: (100, 200), |
This file contains hidden or 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
use std::str::from_utf8; | |
pub enum StrTs<'a> { | |
StrT(&'a str), | |
VecT(Vec<u8>), | |
SliceT(&'a [u8]), | |
} | |
pub enum StrErr { | |
InvalidLength |