Skip to content

Instantly share code, notes, and snippets.

View json_iterator.rs
#![cfg(feature = "alloc")]
use jemallocator;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
use nom::{
branch::alt,
View json_iterator.rs
#![cfg(feature = "alloc")]
use jemallocator;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
use nom::{
branch::alt,
View iterator.rs
extern crate nom;
use nom::IResult;
use nom::bytes::complete::tag;
use nom::sequence::{separated_pair, terminated};
use nom::character::complete::alphanumeric1;
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use std::iter::Iterator;
use std::collections::HashMap;
View combinators.rs
use gen::GenError;
pub trait SerializeFn<I>: Fn(I) -> Result<I, GenError> {}
impl<I, F: Fn(I) ->Result<I, GenError>> SerializeFn<I> for F {}
pub fn slice<'a, S: 'a + AsRef<[u8]>>(data: S) -> impl SerializeFn<&'a mut [u8]> {
let len = data.as_ref().len();
View biscuit.capnp
@0xa9970031d0caaf6d;
struct Biscuit {
authority @0 :Block;
blocks @1 :List(Block);
# each element must be 32 bytes
keys @2 :List(Data);
signature @3 :Signature;
}
View http.rs
#[macro_use]
extern crate bencher;
#[macro_use]
extern crate nom;
extern crate nomfun;
use bencher::{black_box, Bencher};
use nom::IResult;
View appetizer.rs
#[macro_use]
extern crate nom;
#[macro_use]
extern crate bencher;
extern crate fnv;
use fnv::FnvHashMap as HashMap;
use bencher::{Bencher, black_box};
View fun.rs
#[macro_use]
extern crate nom;
use nom::{digit, be_u32, IResult, Err};
named!(first<u32>, flat_map!(digit, parse_to!(u32)));
named!(second<u32>, call!(be_u32));
/*fn or<'a, 'b, F>(input: &'a [u8], left: F, right: F) -> IResult<&'a [u8], u32>
View dog.rs
//extern crate conform;
extern crate flate2;
extern crate image;
extern crate ndarray;
extern crate tar;
extern crate protobuf;
#[allow(unused_imports)]
#[macro_use]
extern crate tract_core;
View gist:45d541e00e9b799eab29f2c13fadc038
$ RUST_BACKTRACE=1 cargo run --bin wasmtime -- testload.wasm --function=load
Finished dev [unoptimized + debuginfo] target(s) in 0.21s
Running `target/debug/wasmtime testload.wasm --function=load`
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:355:21
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
You can’t perform that action at this time.