Merge pull request #140 from Ekleog/next

Handle capitalized user names
This commit is contained in:
Graham Christensen 2018-03-20 13:46:10 -04:00 committed by GitHub
commit d11552addb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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,