/// Detect possible charset.
///
/// In order not to perform any I/O. We only inspect the type of mime to
/// determine the charset.
///
/// - `text/*`, `*/xml`, `*/javascript`, `*/json` -> UTF-8
/// - `*/*+xml`, `*/*+json` -> UTF-8
/// - others -> leave it as is
Detect possible charset.
In order not to perform any I/O. We only inspect the type of mime to
determine the charset.


Detect possible charset . In order not to perform any I / O . We only inspect the type of mime to determine the charset .
fn guess_charset(&self) -> Option<mime::Name> {
        match (self.type_(), self.subtype(), self.suffix()) {
            (mime::TEXT, _, _)
            | (_, mime::XML | mime::JAVASCRIPT | mime::JSON, _)
            | (_, _, Some(mime::XML | mime::JSON)) => Some(mime::UTF_8),
            _ => None,
        }
    }
fn guess_charset ( & self ) -> Option < mime :: Name > { match ( self . type_ ( ) , self . subtype ( ) , self . suffix ( ) ) { ( mime :: TEXT , _ , _ ) | ( _ , mime :: XML | mime :: JAVASCRIPT | mime :: JSON , _ ) | ( _ , _ , Some ( mime :: XML | mime :: JSON ) ) => Some ( mime :: UTF_8 ) , _ => None , } }
Detect possible charset.
Detect possible charset .
&self