Skip to main content

make_web_slug

Function make_web_slug 

Source
pub fn make_web_slug(title: &str) -> String
Expand description

Convert a media title to a url compatible string

use flix_model::text::make_web_slug;

assert_eq!(make_web_slug("The Matrix"), "matrix");
assert_eq!(make_web_slug("Marvel's Agents of S.H.I.E.L.D."), "marvels-agents-of-shield");
assert_eq!(make_web_slug("Avatar: The Last Airbender"), "avatar-the-last-airbender");

ยงPanics

Panics if input is not ASCII.