From 851eb96e28c3868cdc02b884bc7a334f053f20f9 Mon Sep 17 00:00:00 2001 From: Andrew Duffy Date: Mon, 12 Aug 2024 18:25:35 -0400 Subject: [PATCH] docs --- src/builder.rs | 4 ++-- src/lib.rs | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 1dca853..31933db 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -21,8 +21,8 @@ struct Counter { impl Counter { fn new() -> Self { Self { - counts1: vec![0; 511], - counts2: vec![vec![0; 511]; 511], + counts1: vec![0; Code::CODE_MAX as usize], + counts2: vec![vec![0; Code::CODE_MAX as usize]; Code::CODE_MAX as usize], } } diff --git a/src/lib.rs b/src/lib.rs index 390a7bc..068f610 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -98,10 +98,9 @@ pub struct Code(u16); impl Code { /// Maximum code value for the in-memory `Code` representation. - pub const CODE_MAX: u16 = 512; - - /// Maximum code value. Code 255 is reserved as the [escape code][`Self::ESCAPE_CODE`]. - pub const MAX_CODE: u8 = 254; + /// + /// When truncated to u8 this is code 255, which is equivalent to [`Self::ESCAPE_CODE`]. + pub const CODE_MAX: u16 = 511; /// Code used to indicate bytes that are not in the symbol table. ///