From 3e9535a0523700419101e721026dc6e5731aae67 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 5 Dec 2021 02:58:27 +0000 Subject: [PATCH] inline quality tryfrom --- actix-http/src/header/shared/quality.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/actix-http/src/header/shared/quality.rs b/actix-http/src/header/shared/quality.rs index dbe750774..b26080917 100644 --- a/actix-http/src/header/shared/quality.rs +++ b/actix-http/src/header/shared/quality.rs @@ -47,7 +47,7 @@ impl Quality { /// /// # Panics /// Panics in debug mode when value is not in the range 0.0 <= n <= 1.0. - pub(super) fn from_f32(value: f32) -> Self { + fn from_f32(value: f32) -> Self { // Check that `value` is within range should be done before calling this method. // Just in case, this debug_assert should catch if we were forgetful. debug_assert!( @@ -118,6 +118,7 @@ pub struct QualityOutOfBounds; impl TryFrom for Quality { type Error = QualityOutOfBounds; + #[inline] fn try_from(value: f32) -> Result { if (0.0..=MAX_QUALITY_FLOAT).contains(&value) { Ok(Quality::from_f32(value)) @@ -151,6 +152,7 @@ impl TryFrom for Quality { /// # use actix_http::header::q; /// let _q2 = q(1.42); /// ``` +#[inline] pub fn q(quality: T) -> Quality where T: TryInto,