Skip to content

Instantly share code, notes, and snippets.

View ubnt-intrepid's full-sized avatar
🦀
I may be slow to respond.

Yusuke Sasaki ubnt-intrepid

🦀
I may be slow to respond.
View GitHub Profile
@ubnt-intrepid
ubnt-intrepid / highlevel.rs
Last active August 28, 2016 10:23 — forked from anonymous/playground.rs
Shared via Rust Playground
fn main() {
let env = Env::new("highlevel.log").unwrap();
let model = define_model! {
env,
Find: {
"x" @ x => Binary,
"y" @ y => Continuous(1.0, 2.0),
"z" @ z => Integer(100, 200)
@ubnt-intrepid
ubnt-intrepid / playground.rs
Created November 21, 2016 08:24 — forked from anonymous/playground.rs
Shared via Rust Playground
trait SwapCarriable {
type Out;
fn swap_carry(self) -> Self::Out;
}
impl<T> SwapCarriable for Vec<Option<T>> {
type Out = Option<Vec<T>>;
fn swap_carry(self) -> Option<Vec<T>> {
let mut buf = Vec::with_capacity(self.len());
for e in self {
@ubnt-intrepid
ubnt-intrepid / mir.txt
Created June 5, 2017 16:22 — forked from anonymous/playground.rs
Shared via Rust Playground
// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
static <impl at <anon>:11:1: 33:2>::display::__STATIC_FMTSTR: &[&str] = {
let mut _0: &[&str]; // return pointer
let mut _1: &[&str; 2];
let mut _2: &[&str; 2];
let mut _3: [&str; 2];
bb0: {
_3 = [const "", const "\n"]; // scope 0 at <println macros>:3:18: 3:43