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
import Network.HTTP.Conduit | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Lazy as L | |
import qualified Data.ByteString.UTF8 as BU | |
import qualified Data.ByteString.Lazy.UTF8 as LU | |
import qualified Data.Text as T | |
import Data.Conduit | |
import qualified Data.Conduit.List as CL | |
import qualified Data.Conduit.Binary as CB | |
import System.IO |
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
#[feature(globs)] | |
fn private() { | |
println("I am private"); | |
} | |
mod test { | |
use super::*; | |
#[test] |
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 main() | |
// get list of paths | |
assert!(paths.len() > 0); | |
let mut in_common = 0; | |
while paths.iter().all(|path|{ | |
path.components().nth(in_common).map_default(false |comp| { | |
paths[0].components().nth(in_common).map_default(false, |ref_comp| { |
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
Root crate span = 0:10192 | |
Root crate Location: ../rustfind/rustfind.rs | |
Mod Location: ../rustfind/rustfind.rs | |
Mod span = 837:855 | |
Mod name: rf_common | |
Mod Location: ../rustfind/rustfind.rs | |
Mod span = 856:878 | |
Mod name: find_ast_node | |
Mod Location: ../rustfind/rustfind.rs | |
Mod span = 879:903 |
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
macro_rules! kill( | |
($thing:expr) => ( | |
::macros::destroy($thing); | |
) | |
) | |
#[inline] | |
pub fn destroy<T>(_: T) { | |
} |
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
macro_rules! expect( | |
($expr:expr, $value:expr) => ( $expr ) | |
) | |
macro_rules! likely( | |
($expr:expr) => ( expect!($expr != false, true)) | |
) | |
macro_rules! unlikely( | |
($expr:expr) => ( expect!($expr != false, 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
#[feature(macro_rules)]; | |
#[allow(missing_doc)] | |
#[packed] | |
pub struct SIZE_T { | |
v: uint | |
} | |
macro_rules! AARCH( | |
($expr:expr) => ( |
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::cast::transmute; | |
use std::libc::{c_longlong}; | |
macro_rules! A32( | |
($expr:expr) => ( | |
let thing: *u32 = transmute($expr); | |
*thing | |
) | |
) |
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
extern mod extra; | |
extern mod http; | |
use extra::url::Url; | |
use http::client::RequestWriter; | |
use http::method::{Get, Post}; | |
type Session = (); | |
pub fn get_resp(url: Url, post_data: Option<~[u8]>, s: Option<&Session>) -> Result<~[u8], ~str> { |
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
pub fn get_secrets() -> (~str, ~str) { | |
use std::rt::io::{file, Open, Read, Stream}; | |
use std::path::Path; | |
use std::rt::io::file::FileInfo; | |
use std::str::from_utf8; | |
let mut reader : file::FileReader = Path::new("secrets.txt").open_reader(Open) | |
.expect("Secret file couldn't be opened"); | |
let s: ~str = from_utf8(reader.read_to_end()); |