Skip to main content

detect_language_fast

Function detect_language_fast 

Source
pub fn detect_language_fast(input: &str) -> Language
Available on crate feature optimized only.
Expand description

Fast no-allocation language hinting using substring checks only.

§Examples

use http_handle::language::Language;
use http_handle::optimized::detect_language_fast;
assert_eq!(detect_language_fast("fn main() {}"), Language::Rust);

§Panics

This function does not panic.