Skip to content

Instantly share code, notes, and snippets.

View goyox86's full-sized avatar

Jose Narvaez goyox86

View GitHub Profile
goyox86@7031-jnarvaez:~/Code/rust/blog|master⚡
⇒ cargo build
Compiling blog v0.1.0 (file:///Users/goyox86/Code/rust/blog)
error: macro undefined: 'options!'
--> src/main.rs:11:1
|
11 | include!("lib.in.rs");
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro outside of the current crate
func lev(s: String, t: String) -> Int {
if s == t { return 0 }
let sLen = s.characters.count
let tLen = t.characters.count
if sLen == 0 { return tLen }
if tLen == 0 { return sLen }
var d: [[Int]] = []
cargo build --release
Compiling rust-iron v0.0.1 (file:///Users/goyox86/Code/zendesk/zodiac-ingest-framework-benchmarks/rust-iron)
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
--> src/main.rs:33:19
|
33 | let handler = move |request: &mut Request| {
| ^
|
note: the requirement to implement `Fn` derives from here
--> src/main.rs:50:12
[
ClassDecl(
Class {
identifier: ConstExpr(
Constant {
name: "Factorial"
}
),
methods: [
MethodDecl(
# Declare tokens produced by the lexer
token IF ELSE
token DEF
token CLASS
token NEWLINE
token NUMBER
token STRING
token TRUE FALSE NIL
token IDENTIFIER
token CONSTANT
token IF ELSE
token DEF
token CLASS
token NEWLINE
token NUMBER
token STRING
token TRUE FALSE NIL
token IDENTIFIER
token CONSTANT
pub use lexer::{Lexer, Token};
pub struct Parser<'a> {
token: Token,
lexer: Lexer<'a>
}
impl<'a> Parser<'a> {
pub fn new(input: &'a str) -> Parser<'a> {
let mut lexer = Lexer::new(&input);
class Awesome:
def does_it_work:
"yeah!"
awesome_object = Awesome.new
if awesome_object:
print("awesome_object.does_it_work = ")
#![feature(str_char)]
use std::io::prelude::*;
use std::io::BufReader;
use std::fs::File;
const EOF: u8 = 0;
enum Token {
Constant(String),
#[macro_use] extern crate nickel;
extern crate time;
use nickel::{Nickel, HttpRouter};
use std::collections::HashMap;
use std::string::String;
use std::fmt;
use time::Tm;