(&self, resp: Response)
| 74 | } |
| 75 | |
| 76 | async fn resp_to_json<T: DeserializeOwned>(&self, resp: Response) -> Result<T, Error> { |
| 77 | let maybe_json: Result<T, _> = resp.json().await; |
| 78 | if maybe_json.is_err() && self.is_session_bad().await { |
| 79 | Err(Error::CookieError) |
| 80 | } else { |
| 81 | Ok(maybe_json?) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /// Download leetcode problems to db |
| 86 | pub async fn download_problems(self) -> Result<Vec<Problem>, Error> { |
no test coverage detected