Use of take() instead of unwrap()
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user