-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
use std::cmp;
-use symbol::Symbol;
+use crate::symbol::Symbol;
/// Find the Levenshtein distance between two strings
pub fn lev_distance(a: &str, b: &str) -> usize {
return a.chars().count();
}
- let mut dcol: Vec<_> = (0..b.len() + 1).collect();
+ let mut dcol: Vec<_> = (0..=b.len()).collect();
let mut t_last = 0;
for (i, sc) in a.chars().enumerate() {
#[test]
fn test_find_best_match_for_name() {
- use with_globals;
+ use crate::with_globals;
with_globals(|| {
let input = vec![Symbol::intern("aaab"), Symbol::intern("aaabc")];
assert_eq!(