Skip to main content

proposed_id

Function proposed_id 

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

The identity a proposal takes when none is given: the slug of its title, cut at a word boundary within PROPOSED_ID_MAX (64) characters.

use majordomus_cli::intent::proposed_id;
assert_eq!(proposed_id("Make the UI mobile-first!"), "make-the-ui-mobile-first");
let long = "word ".repeat(40);
assert!(proposed_id(&long).len() <= 64 && !proposed_id(&long).ends_with('-'));