From cd2681248aff9931021b0abf63fee40b458496d2 Mon Sep 17 00:00:00 2001 From: bluss Date: Sat, 21 Nov 2015 02:55:54 +0100 Subject: [PATCH] Fix phf::Map::get call This fixes a regression that caused the crate to stop compiling on current rust nightly and beta versions. `cap` is already a `&str`, so passing just `cap` instead of `&cap` is fine. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 874fdb8..fc88389 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -155,7 +155,7 @@ fn to_fixed<'a>(p: String, a: &'a Args) -> String { // 替换拼音中的带声调字符 let py = re_phonetic_symbol.replace_all(&p, |caps: &Captures| { let cap = caps.at(0).unwrap(); - let symbol = match PHONETIC_SYMBOL_MAP.get(&cap) { + let symbol = match PHONETIC_SYMBOL_MAP.get(cap) { Some(&v) => v, None => "", };