mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-23 03:51:00 +00:00
16 lines
374 B
Rust
16 lines
374 B
Rust
use heck::CamelCase;
|
|
use rocket::response::Redirect;
|
|
|
|
/// Remove non alphanumeric characters and CamelCase a string
|
|
pub fn make_actor_id(name: String) -> String {
|
|
name.as_str()
|
|
.to_camel_case()
|
|
.to_string()
|
|
.chars()
|
|
.filter(|c| c.is_alphanumeric())
|
|
.collect()
|
|
}
|
|
|
|
pub fn requires_login() -> Redirect {
|
|
Redirect::to("/login")
|
|
}
|