Skip to content

Commit 44ac897

Browse files
authored
perf(decoder): compile-time validation of decoder header value (#2580)
1 parent 0bcba46 commit 44ac897

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/async_impl/decoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ impl Accepts {
597597
}
598598
*/
599599

600-
pub(super) fn as_str(&self) -> Option<&'static str> {
600+
pub(super) const fn as_str(&self) -> Option<&'static str> {
601601
match (
602602
self.is_gzip(),
603603
self.is_brotli(),
@@ -623,7 +623,7 @@ impl Accepts {
623623
}
624624
}
625625

626-
fn is_gzip(&self) -> bool {
626+
const fn is_gzip(&self) -> bool {
627627
#[cfg(feature = "gzip")]
628628
{
629629
self.gzip
@@ -635,7 +635,7 @@ impl Accepts {
635635
}
636636
}
637637

638-
fn is_brotli(&self) -> bool {
638+
const fn is_brotli(&self) -> bool {
639639
#[cfg(feature = "brotli")]
640640
{
641641
self.brotli
@@ -647,7 +647,7 @@ impl Accepts {
647647
}
648648
}
649649

650-
fn is_zstd(&self) -> bool {
650+
const fn is_zstd(&self) -> bool {
651651
#[cfg(feature = "zstd")]
652652
{
653653
self.zstd
@@ -659,7 +659,7 @@ impl Accepts {
659659
}
660660
}
661661

662-
fn is_deflate(&self) -> bool {
662+
const fn is_deflate(&self) -> bool {
663663
#[cfg(feature = "deflate")]
664664
{
665665
self.deflate

0 commit comments

Comments
 (0)