diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-10-05 19:47:39 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-11-03 15:38:18 +0000 |
commit | f4d3af296c05260dfbb3deea4f8fa400cb6887d3 (patch) | |
tree | 169db2cc68e01a755b30500dd525f1a2ec2da861 /components/net_traits/fetch/headers.rs | |
parent | 863529d9622c68f0a9535225237eb5e5c5b8c757 (diff) | |
download | servo-f4d3af296c05260dfbb3deea4f8fa400cb6887d3.tar.gz servo-f4d3af296c05260dfbb3deea4f8fa400cb6887d3.zip |
Move `*_traits` and other shared types to `shared`
This is the start of the organization of types that are in their own
crates in order to break dependency cycles between other crates. The
idea here is that putting these packages into their own directory is the
first step toward cleaning them up. They have grown organically and it
is difficult to explain to new folks where to put new shared types. Many
of these crates contain more than traits or don't contain traits at all.
Notably, `script_traits` isn't touched because it is vendored from
Gecko. Eventually this will move to `third_party`.
Diffstat (limited to 'components/net_traits/fetch/headers.rs')
-rw-r--r-- | components/net_traits/fetch/headers.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/components/net_traits/fetch/headers.rs b/components/net_traits/fetch/headers.rs deleted file mode 100644 index ae95066bcf5..00000000000 --- a/components/net_traits/fetch/headers.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -use headers::HeaderMap; - -/// <https://fetch.spec.whatwg.org/#concept-header-list-get> -pub fn get_value_from_header_list(name: &str, headers: &HeaderMap) -> Option<Vec<u8>> { - let values = headers.get_all(name).iter().map(|val| val.as_bytes()); - - // Step 1 - if values.size_hint() == (0, Some(0)) { - return None; - } - - // Step 2 - return Some(values.collect::<Vec<&[u8]>>().join(&[0x2C, 0x20][..])); -} |