Skip to content

Instantly share code, notes, and snippets.

pub trait UnaryPredicate<T> {
#[doc(hidden)]
fn call(&self, val: &T) -> bool;
}
impl<T: PartialEq> UnaryPredicate<T> for T {
#[inline(always)]
fn call(&self, val: &T) -> bool {
self == val
}
pub fn sign_up((form, state): (Json<In<SignupUser>>, State<AppState>)) -> impl Future<Item = HttpResponse, Error = Error> {
let signup_user = form.into_inner().user;
let password = hasher().hash(&signup_user.password).unwrap();
let new_user = NewUser {
username: signup_user.username.clone(),
email: signup_user.email.clone(),
password,
bio: None,
name = 'single-panic-test'
operating_system = 'windows'
crate_version = '0.1.0'
explanation = '''
Cause: OMG EVERYTHING IS ON FIRE!!!. Panic occurred in file 'tests\single-panic\src\main.rs' at line 8
'''
cause = 'Error cause could not be determined by the application.'
method = 'Panic'
backtrace = '''
@DoumanAsh
DoumanAsh / example.rs
Created November 2, 2018 05:09
Extracted code from my pong
extern crate amethyst;
const SCORE_COLOR: [f32; 4] = [1.0, 1.0, 1.0, 1.0]; //white
use amethyst::{Application};
use amethyst::renderer::{DisplayConfig, Pipeline, RenderBundle, Stage};
use amethyst::core::transform::bundle::TransformBundle;
use amethyst::core::bundle::SystemBundle;
use amethyst::ecs::prelude::{Dispatcher, DispatcherBuilder, Resources, System, World};
use amethyst::prelude::Builder;
> rusty-tags vi -f --verbose
Switching to single threaded for verbose output
Using configuration: vi_tags='rusty-tags.vi', emacs_tags='rusty-tags.emacs', ctags_exe='None', ctags_options=''
Found ctags executable: UniversalCtags("ctags")
Fetching source and metadata ...
Found package of (itoa, 0.3.4) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\itoa-0.3.4\src'
Found package of (rand, 0.3.18) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\rand-0.3.18\src'
Found package of (kernel32-sys, 0.2.2) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\kernel32-sys-0.2.2\src'
Found package of (rusty-tags, 3.0.0) with source at 'D:\repos\rust-code\rusty-tags\src'
Found package of (syn, 0.11.11) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\syn-0.11.11\src'
> rusty-tags --verbose vi
Switching to single threaded for verbose output
Using configuration: vi_tags='rusty-tags.vi', emacs_tags='rusty-tags.emacs', ctags_exe='None', ctags_options=''
Found ctags executable: UniversalCtags("ctags")
Fetching source and metadata ...
Found package of (atty, 0.2.6) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\atty-0.2.6\src'
Found package of (synom, 0.11.3) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\synom-0.11.3\src'
Found package of (fnv, 1.0.6) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\fnv-1.0.6'
Found package of (winapi, 0.3.6) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\winapi-0.3.6\src'
Found package of (serde_json, 1.0.9) with source at 'D:\soft\Development\rustup\cargo_home\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.9\src'
[[package]]
name = "rand"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
pub struct Builder {
parts: http::request::Parts,
}
impl Builder {
///Starts process of creating request.
pub fn new(uri: hyper::Uri, method: hyper::Method) -> Self {
let parts = http::request::Parts {
method,
uri,
///Modifies data via temporary serialization
pub fn modify<F: FnOnce(&mut Data)>(&'de mut self, cb: F) -> io::Result<()> {
let new_data: Vec<u8> = {
let data = self.inner.as_slice();
let mut data = Ser::deserialize(data)?;
cb(&mut data);
Ser::serialize(&data)?
};
if new_data.len() == 0 {
@DoumanAsh
DoumanAsh / opt1.s
Created April 1, 2018 11:36
opt-level 2 causes incorrect work of TIM16 inerrupt handler
.text
.syntax unified
.eabi_attribute 67, "2.09"
.eabi_attribute 6, 13
.eabi_attribute 7, 77
.eabi_attribute 8, 0
.eabi_attribute 9, 2
.fpu fpv4-sp-d16
.eabi_attribute 27, 1
.eabi_attribute 36, 1