Skip to content

Commit

Permalink
avoid copying name by using deref coercion to convert GuestStr into…
Browse files Browse the repository at this point in the history
… a &str
  • Loading branch information
JakeChampion committed Aug 16, 2021
1 parent e378898 commit 92faacd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/src/wiggle_abi/dictionary_impl.rs
Expand Up @@ -26,8 +26,7 @@ fn read_json_file<P: AsRef<Path>>(file: P) -> serde_json::Map<String, serde_json

impl FastlyDictionary for Session {
fn open(&mut self, name: &GuestPtr<str>) -> Result<DictionaryHandle, Error> {
let name = name.as_str()?.to_owned();
self.dictionary_handle(&name)
self.dictionary_handle(&name.as_str()?)
}

fn get(
Expand Down

0 comments on commit 92faacd

Please sign in to comment.