mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
jid: Fix tests
This commit is contained in:
parent
b28c843eff
commit
6fc3a46bd2
1 changed files with 11 additions and 11 deletions
|
@ -383,9 +383,9 @@ impl FullJid {
|
||||||
/// # fn main() -> Result<(), Error> {
|
/// # fn main() -> Result<(), Error> {
|
||||||
/// let jid = FullJid::new("node@domain/resource")?;
|
/// let jid = FullJid::new("node@domain/resource")?;
|
||||||
///
|
///
|
||||||
/// assert_eq!(jid.node(), Some("node"));
|
/// assert_eq!(jid.node_str(), Some("node"));
|
||||||
/// assert_eq!(jid.domain(), "domain");
|
/// assert_eq!(jid.domain_str(), "domain");
|
||||||
/// assert_eq!(jid.resource(), "resource");
|
/// assert_eq!(jid.resource_str(), "resource");
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -510,8 +510,8 @@ impl BareJid {
|
||||||
/// # fn main() -> Result<(), Error> {
|
/// # fn main() -> Result<(), Error> {
|
||||||
/// let jid = BareJid::new("node@domain")?;
|
/// let jid = BareJid::new("node@domain")?;
|
||||||
///
|
///
|
||||||
/// assert_eq!(jid.node(), Some("node"));
|
/// assert_eq!(jid.node_str(), Some("node"));
|
||||||
/// assert_eq!(jid.domain(), "domain");
|
/// assert_eq!(jid.domain_str(), "domain");
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -584,9 +584,9 @@ impl BareJid {
|
||||||
/// let bare = BareJid::new("node@domain").unwrap();
|
/// let bare = BareJid::new("node@domain").unwrap();
|
||||||
/// let full = bare.with_resource(&resource);
|
/// let full = bare.with_resource(&resource);
|
||||||
///
|
///
|
||||||
/// assert_eq!(full.node(), Some("node"));
|
/// assert_eq!(full.node_str(), Some("node"));
|
||||||
/// assert_eq!(full.domain(), "domain");
|
/// assert_eq!(full.domain_str(), "domain");
|
||||||
/// assert_eq!(full.resource(), "resource");
|
/// assert_eq!(full.resource_str(), "resource");
|
||||||
/// ```
|
/// ```
|
||||||
pub fn with_resource(&self, resource: &ResourcePart) -> FullJid {
|
pub fn with_resource(&self, resource: &ResourcePart) -> FullJid {
|
||||||
let slash = NonZeroU16::new(self.inner.normalized.len() as u16);
|
let slash = NonZeroU16::new(self.inner.normalized.len() as u16);
|
||||||
|
@ -611,9 +611,9 @@ impl BareJid {
|
||||||
/// let bare = BareJid::new("node@domain").unwrap();
|
/// let bare = BareJid::new("node@domain").unwrap();
|
||||||
/// let full = bare.with_resource_str("resource").unwrap();
|
/// let full = bare.with_resource_str("resource").unwrap();
|
||||||
///
|
///
|
||||||
/// assert_eq!(full.node(), Some("node"));
|
/// assert_eq!(full.node_str(), Some("node"));
|
||||||
/// assert_eq!(full.domain(), "domain");
|
/// assert_eq!(full.domain_str(), "domain");
|
||||||
/// assert_eq!(full.resource(), "resource");
|
/// assert_eq!(full.resource_str(), "resource");
|
||||||
/// ```
|
/// ```
|
||||||
pub fn with_resource_str(&self, resource: &str) -> Result<FullJid, Error> {
|
pub fn with_resource_str(&self, resource: &str) -> Result<FullJid, Error> {
|
||||||
let resource = ResourcePart::new(resource)?;
|
let resource = ResourcePart::new(resource)?;
|
||||||
|
|
Loading…
Reference in a new issue