chore(rust): update lockfile and format sources
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -13,13 +13,14 @@ impl MDRSConnection {
|
||||
let resp = self.get("v3/laboratories/").await?;
|
||||
// The API may return a paginated object or a direct array
|
||||
let text = resp.text().await?;
|
||||
let items: Vec<Laboratory> = if let Ok(list) = serde_json::from_str::<Vec<Laboratory>>(&text) {
|
||||
list
|
||||
} else if let Ok(paged) = serde_json::from_str::<LabListResponse>(&text) {
|
||||
paged.results.unwrap_or_default()
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
let items: Vec<Laboratory> =
|
||||
if let Ok(list) = serde_json::from_str::<Vec<Laboratory>>(&text) {
|
||||
list
|
||||
} else if let Ok(paged) = serde_json::from_str::<LabListResponse>(&text) {
|
||||
paged.results.unwrap_or_default()
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
Ok(Laboratories { items })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user