http_type/utils/
request.rs

1use crate::*;
2
3/// Combines a content type and a charset value into a single formatted string.
4///
5/// - `content_type`: The content type (e.g., `"text/html"`).
6/// - `charset`: The character set (e.g., `"utf-8"`).
7/// - Returns: A format string.
8#[inline]
9pub fn content_type_charset(content_type: &str, charset: &str) -> String {
10    format!(
11        "{}{}{}{}",
12        content_type, SEMICOLON_SPACE, CHARSET_EQUAL, charset
13    )
14}
15
16/// Combines a content type and a charset into a single formatted string.
17///
18/// - `content_type`: The content type (e.g., `"text/html"`).
19/// - `charset`: The character set (e.g., `"charset=utf-8"`).
20/// - Returns: A format string.
21#[inline]
22pub fn content_type_charset_with_key(content_type: &str, charset_with_key: &str) -> String {
23    format!("{}{}{}", content_type, SEMICOLON_SPACE, charset_with_key)
24}