Skip to content

Instantly share code, notes, and snippets.

View teru01's full-sized avatar

Teruya Ono teru01

  • Ubie, Inc.
  • Tokyo, JP
View GitHub Profile
@rust-play
rust-play / playground.rs
Created October 2, 2019 08:27
Code shared from the Rust Playground
use std::collections::HashMap;
use std::str;
fn main() {
let s = "a, 100\nb, 200\nw, 20";
let mut m = HashMap::new();
s.split('\n').map(|line| {
let v: Vec<_>= line.split(',').map(str::trim).collect();
println!("{:?}", v);
if v.len() == 2 {
m.insert(v[0], v[1]);
@rust-play
rust-play / playground.rs
Created September 23, 2019 09:22
Code shared from the Rust Playground
use std::fmt::Display;
use std::ops::FnMut;
fn main() {
let a: u64 = 1.cast();
let b: u16 = 1.cast();
let mut v: Vec<&dyn Display> = Vec::new();
v.push(&true);
let mut cl = gen_counter(1);
@rust-play
rust-play / playground.rs
Created September 23, 2019 02:04
Code shared from the Rust Playground
use std::fmt::Display;
use std::ops::FnMut;
fn main() {
let a: u64 = 1.cast();
let b: u16 = 1.cast();
let mut v: Vec<&dyn Display> = Vec::new();
v.push(&true);
let mut cl = gen_counter(1);
@voluntas
voluntas / webrtc.rst
Last active April 5, 2024 03:03
WebRTC コトハジメ