Skip to content

Commit

Permalink
Fix infinite recursion when response has Option<T> (#35)
Browse files Browse the repository at this point in the history
Error log: 
thread 'main' has overflowed its stack

Co-authored-by: chidea <[email protected]>
  • Loading branch information
ohsayan and chidea authored Dec 14, 2024
2 parents 02fbb0b + c424e3b commit 4b91ae2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl<V: FromValue> FromValue for Option<V> {
fn from_value(v: Value) -> ClientResult<Self> {
match v {
Value::Null => Ok(None),
v => FromValue::from_value(v),
v => FromValue::from_value(v).map(|v| Some(v)),
}
}
}
Expand Down

0 comments on commit 4b91ae2

Please sign in to comment.