From 617851917cd47fdeea9882c7210764a0b02a1ac5 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 4 Mar 2024 19:01:33 +0900 Subject: [PATCH] fix: make AcceptRanges::is_bytes method to check only inner value --- src/common/accept_ranges.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/common/accept_ranges.rs b/src/common/accept_ranges.rs index e763fa9d..84da0369 100644 --- a/src/common/accept_ranges.rs +++ b/src/common/accept_ranges.rs @@ -1,5 +1,3 @@ -use http::HeaderValue; - use util::FlatCsv; /// `Accept-Ranges` header, defined in [RFC7233](http://tools.ietf.org/html/rfc7233#section-2.3) @@ -36,12 +34,12 @@ derive_header! { name: ACCEPT_RANGES } -const ACCEPT_RANGES_BYTES: HeaderValue = ::HeaderValue::from_static("bytes"); +const ACCEPT_RANGES_BYTES: &str = "bytes"; impl AcceptRanges { /// A constructor to easily create the common `Accept-Ranges: bytes` header. pub fn bytes() -> Self { - AcceptRanges(ACCEPT_RANGES_BYTES.into()) + AcceptRanges(::HeaderValue::from_static(ACCEPT_RANGES_BYTES).into()) } /// Check if the unit is `bytes`.