Simplify function parameter

This commit is contained in:
Hanno Braun 2024-12-11 20:29:09 +01:00
parent 03d7579b91
commit a9f95d442b
2 changed files with 8 additions and 4 deletions

View File

@ -8,10 +8,14 @@ use winit::{
window::{Window, WindowAttributes, WindowId},
};
use crate::{geometry::OpsLog, render::Renderer, ui::OperationView};
use crate::{
geometry::{AnyOp, OpsLog},
render::Renderer,
ui::OperationView,
};
pub fn run(ops: OpsLog) -> anyhow::Result<()> {
let mut ops = OperationView::new(ops);
let mut ops = OperationView::new(AnyOp::new(ops));
ops.select_last();
let event_loop = EventLoop::new()?;

View File

@ -8,9 +8,9 @@ pub struct OperationView {
}
impl OperationView {
pub fn new(operation: impl Operation + 'static) -> Self {
pub fn new(operation: AnyOp) -> Self {
Self {
operation: AnyOp::new(operation),
operation,
selected: None,
}
}