biliget 0.6.9

简单的B站视频下载工具 支持免登录下载B站高清视频
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use http::HeaderMap;
use std::collections::HashMap;

pub fn to_hashmap(header_map: &HeaderMap) -> HashMap<String, String> {
    let mut hash_map = HashMap::with_capacity(header_map.len());

    for (key, value) in header_map.iter() {
        if let Ok(value_str) = value.to_str() {
            hash_map.insert(key.as_str().to_string(), value_str.to_string());
        }
    }

    hash_map
}