Remove PrivOwnedStr() from Debug formatting
This commit is contained in:
parent
4d1ff8de23
commit
7a70d96235
@ -13,11 +13,19 @@ pub mod r0;
|
|||||||
pub mod session;
|
pub mod session;
|
||||||
pub mod unversioned;
|
pub mod unversioned;
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
pub use error::Error;
|
pub use error::Error;
|
||||||
|
|
||||||
// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
|
// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
|
||||||
// this crate. Used for string enums because their `_Custom` variant can't be
|
// this crate. Used for string enums because their `_Custom` variant can't be
|
||||||
// truly private (only `#[doc(hidden)]`).
|
// truly private (only `#[doc(hidden)]`).
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct PrivOwnedStr(Box<str>);
|
pub struct PrivOwnedStr(Box<str>);
|
||||||
|
|
||||||
|
impl fmt::Debug for PrivOwnedStr {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -16,11 +16,19 @@ pub mod thirdparty;
|
|||||||
mod time;
|
mod time;
|
||||||
pub mod to_device;
|
pub mod to_device;
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
pub use time::{MilliSecondsSinceUnixEpoch, SecondsSinceUnixEpoch};
|
pub use time::{MilliSecondsSinceUnixEpoch, SecondsSinceUnixEpoch};
|
||||||
|
|
||||||
// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
|
// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
|
||||||
// this crate. Used for string enums because their `_Custom` variant can't be
|
// this crate. Used for string enums because their `_Custom` variant can't be
|
||||||
// truly private (only `#[doc(hidden)]`).
|
// truly private (only `#[doc(hidden)]`).
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct PrivOwnedStr(Box<str>);
|
pub struct PrivOwnedStr(Box<str>);
|
||||||
|
|
||||||
|
impl fmt::Debug for PrivOwnedStr {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt;
|
||||||
|
|
||||||
use ruma_identifiers::{EventEncryptionAlgorithm, RoomVersionId};
|
use ruma_identifiers::{EventEncryptionAlgorithm, RoomVersionId};
|
||||||
use ruma_serde::Raw;
|
use ruma_serde::Raw;
|
||||||
@ -391,9 +391,15 @@ pub struct UnsignedDeHelper {
|
|||||||
// this crate. Used for string enums because their `_Custom` variant can't be
|
// this crate. Used for string enums because their `_Custom` variant can't be
|
||||||
// truly private (only `#[doc(hidden)]`).
|
// truly private (only `#[doc(hidden)]`).
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct PrivOwnedStr(Box<str>);
|
pub struct PrivOwnedStr(Box<str>);
|
||||||
|
|
||||||
|
impl fmt::Debug for PrivOwnedStr {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Helper function for erroring when trying to serialize an event enum _Custom variant that can
|
/// Helper function for erroring when trying to serialize an event enum _Custom variant that can
|
||||||
/// only be created by deserializing from an unknown event type.
|
/// only be created by deserializing from an unknown event type.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
mod serde;
|
mod serde;
|
||||||
|
|
||||||
pub mod authorization;
|
pub mod authorization;
|
||||||
@ -28,5 +30,11 @@ pub mod transactions;
|
|||||||
// this crate. Used for string enums because their `_Custom` variant can't be
|
// this crate. Used for string enums because their `_Custom` variant can't be
|
||||||
// truly private (only `#[doc(hidden)]`).
|
// truly private (only `#[doc(hidden)]`).
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct PrivOwnedStr(Box<str>);
|
pub struct PrivOwnedStr(Box<str>);
|
||||||
|
|
||||||
|
impl fmt::Debug for PrivOwnedStr {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -18,6 +18,7 @@ extern crate rand_crate as rand;
|
|||||||
|
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde::de::{self, Deserializer, Unexpected};
|
use serde::de::{self, Deserializer, Unexpected};
|
||||||
@ -188,5 +189,11 @@ macro_rules! user_id {
|
|||||||
// this crate. Used for string enums because their `_Custom` variant can't be
|
// this crate. Used for string enums because their `_Custom` variant can't be
|
||||||
// truly private (only `#[doc(hidden)]`).
|
// truly private (only `#[doc(hidden)]`).
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct PrivOwnedStr(Box<str>);
|
pub struct PrivOwnedStr(Box<str>);
|
||||||
|
|
||||||
|
impl fmt::Debug for PrivOwnedStr {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
pub mod association;
|
pub mod association;
|
||||||
pub mod authentication;
|
pub mod authentication;
|
||||||
pub mod invitation;
|
pub mod invitation;
|
||||||
@ -19,5 +21,11 @@ pub mod tos;
|
|||||||
// this crate. Used for string enums because their `_Custom` variant can't be
|
// this crate. Used for string enums because their `_Custom` variant can't be
|
||||||
// truly private (only `#[doc(hidden)]`).
|
// truly private (only `#[doc(hidden)]`).
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct PrivOwnedStr(Box<str>);
|
pub struct PrivOwnedStr(Box<str>);
|
||||||
|
|
||||||
|
impl fmt::Debug for PrivOwnedStr {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -7,11 +7,19 @@
|
|||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
pub mod send_event_notification;
|
pub mod send_event_notification;
|
||||||
|
|
||||||
// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
|
// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
|
||||||
// this crate. Used for string enums because their `_Custom` variant can't be
|
// this crate. Used for string enums because their `_Custom` variant can't be
|
||||||
// truly private (only `#[doc(hidden)]`).
|
// truly private (only `#[doc(hidden)]`).
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct PrivOwnedStr(Box<str>);
|
pub struct PrivOwnedStr(Box<str>);
|
||||||
|
|
||||||
|
impl fmt::Debug for PrivOwnedStr {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user