1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

improve typed header macro (#2481)

This commit is contained in:
Rob Ede
2021-12-02 15:25:39 +00:00
committed by GitHub
parent 075d871e63
commit 2a72bdae09
29 changed files with 147 additions and 100 deletions

View File

@@ -27,7 +27,7 @@ const MAX_FLOAT_QUALITY: f32 = 1.0;
///
/// [RFC 7231 §5.3.1](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.1) gives more
/// information on quality values in HTTP header fields.
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Quality(u16);
impl Quality {
@@ -80,7 +80,7 @@ impl TryFrom<f32> for Quality {
/// Represents an item with a quality value as defined
/// in [RFC 7231 §5.3.1](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.1).
#[derive(Clone, PartialEq, Debug)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct QualityItem<T> {
/// The wrapped contents of the field.
pub item: T,