From: Ian Jackson Date: Fri, 2 Apr 2021 19:53:46 +0000 (+0100) Subject: movehist: Move LENS etc. to otter, out of base X-Git-Tag: otter-0.5.0~297 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d440527ed98e456924a665358d6f5a43d204eafd;p=otter.git movehist: Move LENS etc. to otter, out of base We're going to send this as literals, not via wasm. Signed-off-by: Ian Jackson --- diff --git a/base/misc.rs b/base/misc.rs index f7982cdb..7ee1c6f5 100644 --- a/base/misc.rs +++ b/base/misc.rs @@ -9,15 +9,6 @@ use crate::prelude::*; pub const SVG_SCALE: f64 = 6.; -pub const MOVEHIST_LENS: &[usize] = &[ 1, 3, 10, 0]; -pub const MOVEHIST_LEN_MAX: usize = 10; - -#[test] -fn movehist_len_max() { assert_eq!( - MOVEHIST_LENS.iter().max(), - Some(&MOVEHIST_LEN_MAX), -) } - pub fn timestring_abbreviate<'x>(base: &str, this: &'x str) -> (&'x str, bool) { diff --git a/src/movehist.rs b/src/movehist.rs index 85baca41..aa436e3e 100644 --- a/src/movehist.rs +++ b/src/movehist.rs @@ -4,6 +4,15 @@ use super::*; // we are otter::updates::movehist +pub const MOVEHIST_LENS: &[usize] = &[ 1, 3, 10, 0]; +pub const MOVEHIST_LEN_MAX: usize = 10; + +#[test] +fn movehist_len_max() { assert_eq!( + MOVEHIST_LENS.iter().max(), + Some(&MOVEHIST_LEN_MAX), +) } + #[derive(Debug,Copy,Clone,Serialize,Deserialize)] pub struct MoveHistPosx { // usual variable: posx pub pos: Pos, diff --git a/src/prelude.rs b/src/prelude.rs index aa10014f..6b051ed3 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -146,6 +146,7 @@ pub use crate::toml_de; pub use crate::tz::*; pub use crate::updates::*; pub use crate::updates::movehist::{self, GMoveHeld, GMoveHist, MoveHistEnt}; +pub use crate::updates::movehist::{MOVEHIST_LENS, MOVEHIST_LEN_MAX}; pub use crate::utils::*; pub use crate::ui::*;