Skip to content

Commit

Permalink
make huffman (h2) tables static
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDC committed Feb 7, 2025
1 parent d2588cb commit 8c03fb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rama-http-core/src/h2/hpack/huffman/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// (num-bits, bits)
#[allow(clippy::large_const_arrays)]
pub(super) const ENCODE_TABLE: [(usize, u64); 257] = [
pub(super) static ENCODE_TABLE: [(usize, u64); 257] = [
(13, 0x1ff8),
(23, 0x007f_ffd8),
(28, 0x0fff_ffe2),
Expand Down Expand Up @@ -264,7 +264,7 @@ pub(super) const ENCODE_TABLE: [(usize, u64); 257] = [

// (next-state, byte, flags)
#[allow(clippy::large_const_arrays)]
pub(super) const DECODE_TABLE: [[(usize, u8, u8); 16]; 256] = [
pub(super) static DECODE_TABLE: [[(usize, u8, u8); 16]; 256] = [
// 0
[
(4, 0, 0x00),
Expand Down
2 changes: 1 addition & 1 deletion rama-http-core/util/genhuff/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ pub fn main() {

println!();
println!("// (next-state, byte, flags)");
println!("pub const DECODE_TABLE: [[(usize, u8, u8); 16]; 256] = [");
println!("pub(super) static DECODE_TABLE: [[(usize, u8, u8); 16]; 256] = [");

decode.print();

Expand Down

0 comments on commit 8c03fb8

Please sign in to comment.