aboutsummaryrefslogtreecommitdiff
path: root/src/guide.rs
blob: 85d05940e18e884272a7de0de2c765eec15c7b37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::{
    bitmap::Axis,
    lisp::{expr::LispExpr, number::LispNumber},
};

use std::convert::Into;

#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)]
pub struct Guide {
    pub axis: Axis,
    pub offset: u32,
}

impl Into<LispExpr> for Guide {
    fn into(self) -> LispExpr {
        LispExpr::List(vec![
            self.axis.into(),
            LispExpr::Number(LispNumber::Integer(self.offset as i64)),
        ])
    }
}