http-type 22.0.10

A comprehensive Rust type library for HTTP operations and concurrent programming. Provides core HTTP types (Request/Response with builder patterns, Method, HttpStatus, HttpVersion, ContentType, FileExtension with MIME mapping, Cookie parsing/building, HttpUrl parsing, WebSocket frame/opcode, protocol upgrade types, stream/task management, panic handling), thread-safe concurrent wrappers (ArcMutex, ArcRwLock, BoxRwLock, RcRwLock), dynamic dispatch types (BoxAny, RcAny, ArcAny with Send/Sync variants), high-performance hash collections (HashMapXxHash3_64, HashSetXxHash3_64), and static lifetime utilities (BoxLeak, Lifetime trait).
Documentation
use super::*;

/// The content type a response announces when the application chose none.
///
/// It is built once and then shared, so a response that does not choose a
/// content type does not build the value again for every request.
///
/// # Returns
///
/// - `&'static str` - The default content type.
pub(crate) fn default_content_type() -> &'static str {
    static DEFAULT_CONTENT_TYPE: OnceLock<String> = OnceLock::new();
    DEFAULT_CONTENT_TYPE.get_or_init(|| {
        let mut content_type: String =
            String::with_capacity(TEXT_HTML.len() + SEMICOLON_SPACE.len() + CHARSET_UTF_8.len());
        content_type.push_str(TEXT_HTML);
        content_type.push_str(SEMICOLON_SPACE);
        content_type.push_str(CHARSET_UTF_8);
        content_type
    })
}