Skip to main content

slugify_author

Function slugify_author 

Source
pub fn slugify_author(name: &str, email: &str) -> String
Expand description

Create a URL-safe slug from a git author name and email.

Prefers the email username; falls back to the name.

ยงExamples

use toolpath_git::slugify_author;

assert_eq!(slugify_author("Alex Smith", "asmith@example.com"), "asmith");
assert_eq!(slugify_author("Alex Smith", "unknown"), "alex-smith");