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
| fn greet_world() { | |
| println!("Hello, world!"); // our old friend. | |
| let southern_germany = "Grüß Gott!"; | |
| let japan = "ハロー・ワールド"; | |
| let regions = [southern_germany, japan]; | |
| for region in regions.iter() { | |
| println!("{}", ®ion); |
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 lexer::lex_token; | |
| use lexer::lexer_parts::literal_lexer; | |
| use constants::TokenTypes; | |
| use constants::operations::OPARRAY; | |
| use constants::delimiters::SEMICOLON; | |
| use constants::datatypes::DATATYPESARRAY; | |
| use constants::reserved_constants::RESERVEDCONSTANTSARRAY; | |
| use constants::accessident::ACCESSIDENTARRAY; | |
| use lexer::lexer_parts::data_type_lexer; | |
| use lexer::lexer_parts::op_token_lexer; |
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 lexer::lex_token; | |
| use lexer::lexer_parts::literal_lexer; | |
| use constants::TokenTypes; | |
| use constants::operations::OPARRAY; | |
| use constants::delimiters::SEMICOLON; | |
| use constants::datatypes::DATATYPESARRAY; | |
| use constants::reserved_constants::RESERVEDCONSTANTSARRAY; | |
| use constants::accessident::ACCESSIDENTARRAY; | |
| use lexer::lexer_parts::data_type_lexer; | |
| use lexer::lexer_parts::op_token_lexer; |
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 lexer::lex_token; | |
| use lexer::lexer_parts::literal_lexer; | |
| use constants::TokenTypes; | |
| use constants::operations::OPARRAY; | |
| use constants::delimiters::SEMICOLON; | |
| use constants::datatypes::DATATYPESARRAY; | |
| use constants::reserved_constants::RESERVEDCONSTANTSARRAY; | |
| use lexer::lexer_parts::data_type_lexer; | |
| use lexer::lexer_parts::op_token_lexer; | |
| use lexer::lexer_parts::end_token_lexer; |
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 chrono; | |
| extern crate rand; | |
| use std::rc::Rc; | |
| use std::mem; | |
| use List::{Cons, Nil}; | |
| use chrono::*; | |
| use std::collections::HashMap; | |
| use std::fmt::Display; | |
| use rand::Rng; |
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
| fn foo<'a, I>(grr: I) where I: Iterator<Item=&'a str> { | |
| let numbers = grr.map(str::parse::<f64>); | |
| } | |
| 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
| fn foo<'a, I>(grr: I) where I: Iterator<Item=String> { | |
| let numbers = grr.map(|s| s.parse::<f64>()); | |
| } | |
| 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
| #![feature(specialization)] | |
| trait Foo<T: DefaultFooBehavior> { | |
| fn bar() { | |
| T::do_stuff(); | |
| } | |
| } | |
| trait DefaultFooBehavior { | |
| fn do_stuff(); |
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
| #![feature(specialization)] | |
| struct Baz; | |
| trait Foo<T> { | |
| fn bar(); | |
| } | |
| default impl<T> Foo<Baz> for T { | |
| fn bar() { |
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::fmt::Display; | |
| trait Bar<T: Display> { | |
| fn foo(&self, s: T) { | |
| println!("{}", s) | |
| } | |
| } | |
| struct Foo; |