WOO
This commit is contained in:
@@ -5,6 +5,7 @@ use rusb::UsbContext;
|
|||||||
use gilrs::{Gilrs, Button, Event};
|
use gilrs::{Gilrs, Button, Event};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use handlebars::Handlebars;
|
use handlebars::Handlebars;
|
||||||
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
pub trait InputStream {
|
pub trait InputStream {
|
||||||
fn get(&mut self) -> Vec<char>;
|
fn get(&mut self) -> Vec<char>;
|
||||||
@@ -222,6 +223,7 @@ fn sprintf(x: &String, v: Vec<char>) -> Vec<char> {
|
|||||||
let mut reg = Handlebars::new();
|
let mut reg = Handlebars::new();
|
||||||
return reg.render_template(x, &json!({
|
return reg.render_template(x, &json!({
|
||||||
"VALUE": v.iter().collect::<String>(),
|
"VALUE": v.iter().collect::<String>(),
|
||||||
|
"ms_since_epoch": SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis(),
|
||||||
})).unwrap().chars().collect();
|
})).unwrap().chars().collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user