From bc0e5a406a0179fdbc7a5e298d108e966bcb3ed0 Mon Sep 17 00:00:00 2001 From: Agathe Porte Date: Sun, 23 Feb 2020 10:30:17 +0100 Subject: add goto functions --- src/codes.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/codes.rs') diff --git a/src/codes.rs b/src/codes.rs index 2111df7..e397df8 100644 --- a/src/codes.rs +++ b/src/codes.rs @@ -46,6 +46,7 @@ pub enum SpecialCode { GotoXY(Option, Option), } +/// Write a X or Y goto symbol, as required fn write_goto_xy_sym(writer: &mut T, sym: char, value: Option) -> Result { let mut total = 0; if let Some(value) = value { @@ -55,6 +56,7 @@ fn write_goto_xy_sym(writer: &mut T, sym: char, value: Option) -> Ok(total) } +/// Write both X and/or Y goto symbol, as required fn write_goto_xy(writer: &mut T, x: Option, y: Option) -> Result { let mut total = 0; total += write_goto_xy_sym(writer, 'x', x)?; -- cgit v1.2.3