You've already forked pages
forked from didirus/AstralRinth
Some small Labrinth refactors and fixes (#3698)
* chore(labrinth): fix typos, simplify out `remove_duplicates` func * fix(labrinth): implement `capitalize_first` so that it can't panic on wide chars * chore(labrinth): refactor out unneeded clone highlighted by nightly Clippy lints * chore(labrinth): simplify `capitalize_first` implementation * fix(labrinth): preserve ordering when deduplicating project field values This addresses an unintended behavior change on 157647faf2778c74096e624aeef9cdb79539489c. * fix(labrinth/tests): make `index_swaps` test run successfully I wonder why we don't run these more often... * refactor: rename `.env.example` files to `.env.local`, make local envs more consistent between frontend and backend * chore(labrinth/.env.local): proper email verif. and password reset paths
This commit is contained in:
committed by
GitHub
parent
be37f077d3
commit
a9cfc37aac
@@ -264,11 +264,11 @@ pub fn convert_side_types_v2_bools(
|
||||
}
|
||||
|
||||
pub fn capitalize_first(input: &str) -> String {
|
||||
let mut result = input.to_owned();
|
||||
if let Some(first_char) = result.get_mut(0..1) {
|
||||
first_char.make_ascii_uppercase();
|
||||
}
|
||||
result
|
||||
input
|
||||
.chars()
|
||||
.enumerate()
|
||||
.map(|(i, c)| if i == 0 { c.to_ascii_uppercase() } else { c })
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user