You can't. If the deserialized value is borrowed (and that's what the lifetime specifier in Deserialize means), then the value it's borrowing from - the str_json, in this case - must be alive at least as long as the deserialized value itself. You want to either using DeserializeOwned instead of Deserialize<'a>, or pass the String to update function, with the second way being considerably harder.