Skip to main content

names

Function names 

Source
pub fn names(code: &str, subject: &str) -> bool
Expand description

Does the code name the subject as an identifier, rather than inside a longer word?

use majordomus_cli::quality::policy::names;
assert!(names("let x = Thing::new();", "Thing"));
assert!(!names("let x = ThingBuilder::new();", "Thing"), "not a prefix of another name");
assert!(names("thing.parse();", "parse"));