rely on deriving traits instead

This commit is contained in:
2025-03-24 16:42:14 -04:00
parent f1b9f9ad30
commit 735a820799
4 changed files with 11 additions and 102 deletions

View File

@@ -1,22 +1,12 @@
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Buf {
pub width: usize,
pub height: usize,
pub buf: Vec<f32>,
}
impl Clone for Buf {
fn clone(&self) -> Buf {
Buf {
width: self.width,
height: self.height,
buf: self.buf.clone(),
}
}
}
impl Buf {
pub fn new(width: usize, height: usize, buf: Vec<f32>) -> Self {
pub const fn new(width: usize, height: usize, buf: Vec<f32>) -> Self {
Buf { width, height, buf }
}