This file contains 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
priv use std::prelude::*; | |
priv extern mod std; | |
mod __std_macros { | |
#[macro_escape]; | |
#[doc(hidden)]; | |
priv use std::prelude::*; | |
} | |
static SQUARE_SIZE: uint = 256; | |
static DEMI_SQUARE_SIZE: uint = SQUARE_SIZE / 2; |
This file contains 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
fn r̄ͬ̇ͦ̓u͗͗̅̐s̔̈́ͯ̄̓ͭ͋tͣͯͦ̂̃̆̓_̍͌̉̃l̆a͐̾̿̋̈́n̉ͬͥ́ͪ̊gͭ͛̾_́cͪͬ͑͂̈oͭͨ̊̋̓ͧm̌̿̐̿ͤ̆͐e̔̓̆ͭͨ̾̚s() { | |
println("ĭ̒̚tͧ̂͆ͫ̄ ̃ͬ͗̍̂c̈͒̊õ͑̓ͩͦ͒m̊͗̐̒esͩ͛!ͨ̀ͩ̀͆̄̚ ĭ̿̈̍̀ͮ͑tͦ͂̉̒̔̇ ̓co͛́̾ͤ̄̉͌m͂͆̀ͫe͛ͨ͌̇͆ͣͥs͂!̇̌̎̆"); | |
} | |
fn main() { | |
r̄ͬ̇ͦ̓u͗͗̅̐s̔̈́ͯ̄̓ͭ͋tͣͯͦ̂̃̆̓_̍͌̉̃l̆a͐̾̿̋̈́n̉ͬͥ́ͪ̊gͭ͛̾_́cͪͬ͑͂̈oͭͨ̊̋̓ͧm̌̿̐̿ͤ̆͐e̔̓̆ͭͨ̾̚s(); | |
} |
This file contains 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
let (cfg, appCfg) = if nix {( | |
& Path::new ( "~/.Sync.conf" ) , | |
& Path::new ( "~/.Mirana.conf" ) | |
)} else { | |
let prefix = getenv("HOME").unwrap_or(~""); | |
( | |
& Path::new ( prefix + "~/.Sync.conf" ), | |
& Path::new ( prefix + "~/.Mirana.conf" ) | |
) | |
}; |
This file contains 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 output_stream::OutputStream; | |
use message::Message; | |
use wire_type::LengthDelimited; | |
pub struct OutputCounter { | |
byte_count: uint, | |
nested: ~[uint] | |
} | |
impl OutputCounter { |
This file contains 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
trait Category<S, T> { | |
fn id<A, AA: Category<A, A>>() -> AA; | |
fn compose<A, B, C, AB: Category<A, B>, BC: Category<B, C>, AC: Category<A, C>>(BC, AB) -> AC; | |
} | |
impl<'a, S, T> Category<S, T> for ('a |S| -> T) { | |
fn id<A, |A| -> A>() -> ('a |A| -> A) { | |
|a: A| -> A { a } | |
} |
This file contains 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
struct NotFancy<T> { | |
x: Option<T> | |
} | |
impl<T> NotFancy<T> { | |
fn simple0<'a>(&'a self) -> Option<&'a T> { | |
match *self.x { | |
Some(ref t) => Some(t), | |
None => None | |
} |
This file contains 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 X { | |
A(~str), | |
B(~str) | |
} | |
struct Y { | |
x: X | |
} | |
fn f(a: &mut Y) { |
This file contains 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
mod config { | |
pub enum Node<T> { | |
Directory(~str, ~[Node<T>]), | |
Entry(~str, ~T) | |
} | |
pub fn add_entry<T>(node: &Node<T>, entry: &Node<T>) -> ::std::option::Option<&Node<T>> { | |
match node { | |
Directory(name, list) => { ::std::vec::append_one(list, entry); Some(node) } | |
_ => { None } |
This file contains 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
mod config { | |
pub enum Node<T> { | |
Directory(~str, ~[Node<T>]), | |
Entry(~str, ~T) | |
} | |
pub fn add_entry<'a, T>(node: &'a mut Node<T>, entry: Node<T>) -> Option<&'a mut Node<T>> { | |
if match node { | |
&Directory(_, ref mut list) => { list.push(entry); true } | |
_ => false |
This file contains 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::{io,mem,raw,cast}; | |
struct BlobContainingSlices<'a> { | |
data:~[u8], | |
subset1: &'a [u32], | |
subset2: &'a [u16], | |
} | |
fn slice_within_as<TO,FROM>(owner:&[FROM], start:uint, len_in_new_units:uint)->&[TO] { |
OlderNewer