Don’t take response output by reference
This commit is contained in:
parent
4b14837009
commit
2323222f2d
1 changed files with 3 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue