diff --git a/Cargo.toml b/Cargo.toml index 0fe3f16a6..b9ffc60b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,3 +18,6 @@ tokio-minihttp = { git = "https://github.com/tokio-rs/tokio-minihttp.git" } tokio-proto = "0.1" tokio-service = "0.1" url = "1.7" + +[profile.release] +lto = true diff --git a/src/bin/raptor.rs b/src/bin/raptor.rs index 8bbb77fe2..125bb90a7 100644 --- a/src/bin/raptor.rs +++ b/src/bin/raptor.rs @@ -54,7 +54,11 @@ impl Service for MainService { if let Some((_, key)) = url.query_pairs().find(|&(ref k, _)| k == "q") { let key = key.to_lowercase(); - let lev = Levenshtein::new(&key, 2).unwrap(); + let lev = if key.len() <= 8 { + Levenshtein::new(&key, 1).unwrap() + } else { + Levenshtein::new(&key, 2).unwrap() + }; let mut body = String::new(); body.push_str("");