We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4252879 commit f0992e3Copy full SHA for f0992e3
src/cargo/util/lev_distance.rs
@@ -1,6 +1,11 @@
1
use std::cmp;
2
3
pub fn lev_distance(me: &str, t: &str) -> usize {
4
+ // Comparing the strings lowercased will result in a difference in capitalization being less distance away
5
+ // than being a completely different letter. Otherwise `CHECK` is as far away from `check` as it
6
+ // is from `build` (both with a distance of 5). For a single letter shortcut (e.g. `b` or `c`), they will
7
+ // all be as far away from any capital single letter entry (all with a distance of 1).
8
+ // By first lowercasing the strings, `C` and `c` are closer than `C` and `b`, for example.
9
let me = me.to_lowercase();
10
let t = t.to_lowercase();
11
0 commit comments