minidom, tokio-xmpp: Use Option::as_deref()
This simplifies the Option::as_ref().map(|foo| &**foo) pattern a lot. skip-changelog: Completely internal change.
This commit is contained in:
parent
75e0cb7dc3
commit
a8c66bc783
3 changed files with 7 additions and 7 deletions
|
|
@ -33,9 +33,9 @@ impl<Io> AcceptedStream<Io> {
|
|||
/// The stream header contents as sent by the peer.
|
||||
pub fn header(&self) -> StreamHeader<'_> {
|
||||
StreamHeader {
|
||||
from: self.header.from.as_ref().map(|x| Cow::Borrowed(&**x)),
|
||||
to: self.header.to.as_ref().map(|x| Cow::Borrowed(&**x)),
|
||||
id: self.header.id.as_ref().map(|x| Cow::Borrowed(&**x)),
|
||||
from: self.header.from.as_deref().map(Cow::Borrowed),
|
||||
to: self.header.to.as_deref().map(Cow::Borrowed),
|
||||
id: self.header.id.as_deref().map(Cow::Borrowed),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue