Don’t take response output by reference

This commit is contained in:
Tobie Morgan Hitchcock 2022-11-23 09:11:58 +00:00
parent 4b14837009
commit 2323222f2d

View file

@ -16,12 +16,9 @@ impl Response {
pub fn speed(&self) -> String {
format!("{:?}", self.time)
}
/// Retrieve the response as a result by reference
pub fn output(&self) -> Result<&Value, &Error> {
match &self.result {
Ok(v) => Ok(v),
Err(e) => Err(e),
}
/// Retrieve the response as a normal result
pub fn output(self) -> Result<Value, Error> {
self.result
}
}