(
&self,
key: PyRef<ContextVar>,
default: OptionalArg<PyObjectRef>,
)
| 200 | |
| 201 | #[pymethod] |
| 202 | fn get( |
| 203 | &self, |
| 204 | key: PyRef<ContextVar>, |
| 205 | default: OptionalArg<PyObjectRef>, |
| 206 | ) -> PyResult<Option<PyObjectRef>> { |
| 207 | let found = self.get_inner(&key); |
| 208 | let result = if let Some(found) = found { |
| 209 | Some(found.to_owned()) |
| 210 | } else { |
| 211 | default.into_option() |
| 212 | }; |
| 213 | Ok(result) |
| 214 | } |
| 215 | |
| 216 | // TODO: wrong return type |
| 217 | #[pymethod] |
no test coverage detected