Handle capitalized user names

This commit is contained in:
Léo Gaspard 2018-03-20 18:37:16 +01:00
parent ff71d83893
commit c88d98b6a2
No known key found for this signature in database
GPG key ID: 8A55848B6090F9CF

View file

@ -6,7 +6,13 @@ pub struct ACL {
}
impl ACL {
pub fn new(repos: Vec<String>, trusted_users: Vec<String>, known_users: Vec<String>) -> ACL {
pub fn new(
repos: Vec<String>,
mut trusted_users: Vec<String>,
mut known_users: Vec<String>
) -> ACL {
trusted_users.iter_mut().map(|x| *x = x.to_lowercase()).last();
known_users.iter_mut().map(|x| *x = x.to_lowercase()).last();
return ACL {
trusted_users: trusted_users,
known_users: known_users,