diff options
Diffstat (limited to 'src/guide.rs')
-rw-r--r-- | src/guide.rs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/guide.rs b/src/guide.rs index 006566e..85d0594 100644 --- a/src/guide.rs +++ b/src/guide.rs | |||
@@ -1,7 +1,21 @@ | |||
1 | use crate::bitmap::Axis; | 1 | use crate::{ |
2 | bitmap::Axis, | ||
3 | lisp::{expr::LispExpr, number::LispNumber}, | ||
4 | }; | ||
2 | 5 | ||
3 | #[derive(Debug)] | 6 | use std::convert::Into; |
7 | |||
8 | #[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)] | ||
4 | pub struct Guide { | 9 | pub struct Guide { |
5 | axis: Axis, | 10 | pub axis: Axis, |
6 | offset: u32, | 11 | pub offset: u32, |
12 | } | ||
13 | |||
14 | impl Into<LispExpr> for Guide { | ||
15 | fn into(self) -> LispExpr { | ||
16 | LispExpr::List(vec![ | ||
17 | self.axis.into(), | ||
18 | LispExpr::Number(LispNumber::Integer(self.offset as i64)), | ||
19 | ]) | ||
20 | } | ||
7 | } | 21 | } |