Another round of optimization
This commit is contained in:
@@ -4,7 +4,7 @@ use rand::SeedableRng;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
pub fn default_ctx() -> StepContext {
|
||||
pub fn default_ctx() -> StepContext<'static> {
|
||||
StepContext {
|
||||
step: 0,
|
||||
beat: 0.0,
|
||||
@@ -19,10 +19,12 @@ pub fn default_ctx() -> StepContext {
|
||||
fill: false,
|
||||
nudge_secs: 0.0,
|
||||
cc_access: None,
|
||||
speed_key: "__speed_0_0__",
|
||||
chain_key: "__chain_0_0__",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ctx_with(f: impl FnOnce(&mut StepContext)) -> StepContext {
|
||||
pub fn ctx_with(f: impl FnOnce(&mut StepContext<'static>)) -> StepContext<'static> {
|
||||
let mut ctx = default_ctx();
|
||||
f(&mut ctx);
|
||||
ctx
|
||||
|
||||
Reference in New Issue
Block a user