1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

Quality / QualityItem improvements (#2486)

This commit is contained in:
Rob Ede
2021-12-05 03:38:08 +00:00
committed by GitHub
parent d89c706cd6
commit e1a2d9c606
16 changed files with 494 additions and 257 deletions

View File

@ -435,10 +435,10 @@ impl Field {
/// Returns the field's Content-Disposition.
///
/// Per [RFC 7578 §4.2]: 'Each part MUST contain a Content-Disposition header field where the
/// disposition type is "form-data". The Content-Disposition header field MUST also contain an
/// additional parameter of "name"; the value of the "name" parameter is the original field name
/// from the form.'
/// Per [RFC 7578 §4.2]: "Each part MUST contain a Content-Disposition header field where the
/// disposition type is `form-data`. The Content-Disposition header field MUST also contain an
/// additional parameter of `name`; the value of the `name` parameter is the original field name
/// from the form."
///
/// This crate validates that it exists before returning a `Field`. As such, it is safe to
/// unwrap `.content_disposition().get_name()`. The [name](Self::name) method is provided as
@ -451,7 +451,8 @@ impl Field {
/// Returns the field's name.
///
/// See [content_disposition] regarding guarantees about
/// See [content_disposition](Self::content_disposition) regarding guarantees about existence of
/// the name field.
pub fn name(&self) -> &str {
self.content_disposition()
.get_name()