Plume/src/utils.rs

12 lines
274 B
Rust
Raw Normal View History

2018-04-23 12:54:37 +02:00
use heck::CamelCase;
/// Remove non alphanumeric characters and CamelCase a string
2018-04-23 12:54:37 +02:00
pub fn make_actor_id(name: String) -> String {
name.as_str()
.to_camel_case()
.to_string()
.chars()
.filter(|c| c.is_alphanumeric())
.collect()
2018-04-23 12:54:37 +02:00
}