Refine docs and comments etc.

This commit is contained in:
Stephen Chung
2021-01-02 23:30:10 +08:00
parent 5a3bbaa322
commit ef48f47b74
22 changed files with 352 additions and 296 deletions

View File

@@ -173,11 +173,9 @@ impl<'e> ParseState<'e> {
) -> ImmutableString {
#[allow(clippy::map_entry)]
if !self.strings.contains_key(text.as_ref()) {
let value: ImmutableString = text.into();
let result = value.clone();
let key = value.to_string();
self.strings.insert(key, value);
result
let value = text.into();
self.strings.insert(value.clone().into(), value.clone());
value
} else {
self.strings.get(text.as_ref()).unwrap().clone()
}