Use of take() instead of unwrap()

This commit is contained in:
Mauro D
2022-07-17 17:20:24 +00:00
parent 5cc21ed1b5
commit 8b20a25461
23 changed files with 165 additions and 39 deletions

View File

@@ -9,8 +9,8 @@ impl Principal<Get> {
self.id.as_deref()
}
pub fn unwrap_id(self) -> String {
self.id.unwrap_or_default()
pub fn take_id(&mut self) -> String {
self.id.take().unwrap_or_default()
}
pub fn ptype(&self) -> Option<&Type> {

View File

@@ -212,7 +212,7 @@ impl Client {
request
.send_single::<PrincipalGetResponse>()
.await
.map(|mut r| r.unwrap_list().pop())
.map(|mut r| r.take_list().pop())
}
pub async fn principal_query(