Add reasons for each doctest ignore
This commit is contained in:
parent
058d2bfa24
commit
b616ba8233
@ -9,6 +9,7 @@
|
|||||||
//! provided for the client (feature `client-api`):
|
//! provided for the client (feature `client-api`):
|
||||||
//!
|
//!
|
||||||
//! ```ignore
|
//! ```ignore
|
||||||
|
//! # // HACK: "ignore" the doctest here because client.log_in needs client-api feature.
|
||||||
//! // type MatrixClient = ruma_client::Client<ruma_client::http_client::_>;
|
//! // type MatrixClient = ruma_client::Client<ruma_client::http_client::_>;
|
||||||
//! # type MatrixClient = ruma_client::Client<ruma_client::http_client::Dummy>;
|
//! # type MatrixClient = ruma_client::Client<ruma_client::http_client::Dummy>;
|
||||||
//! # let work = async {
|
//! # let work = async {
|
||||||
@ -89,6 +90,7 @@ extern crate hyper_rustls_crate as hyper_rustls;
|
|||||||
extern crate isahc_crate as isahc;
|
extern crate isahc_crate as isahc;
|
||||||
|
|
||||||
#[cfg(feature = "client-api")]
|
#[cfg(feature = "client-api")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
|
||||||
mod client_api;
|
mod client_api;
|
||||||
mod error;
|
mod error;
|
||||||
pub mod http_client;
|
pub mod http_client;
|
||||||
|
@ -31,16 +31,20 @@ mod event_parse;
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
|
/// # // HACK: This is "ignore" because of cyclical dependency drama.
|
||||||
/// use ruma_events_macros::event_enum;
|
/// use ruma_events_macros::event_enum;
|
||||||
///
|
///
|
||||||
/// event_enum! {
|
/// event_enum! {
|
||||||
/// name: AnyBarEvent, // `BarEvent` has to be a valid type at `::ruma_events::BarEvent`
|
/// kind: ToDevice,
|
||||||
/// events: [
|
/// events: [
|
||||||
/// "m.any.event",
|
/// "m.any.event",
|
||||||
/// "m.other.event",
|
/// "m.other.event",
|
||||||
/// ]
|
/// ]
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
/// (The argument to `kind` has to be a valid identifier for `<EventKind as Parse>::parse`)
|
||||||
|
//// TODO: Change above (`<EventKind as Parse>::parse`) to [] after fully qualified syntax is
|
||||||
|
//// supported: https://github.com/rust-lang/rust/issues/74563
|
||||||
#[proc_macro]
|
#[proc_macro]
|
||||||
pub fn event_enum(input: TokenStream) -> TokenStream {
|
pub fn event_enum(input: TokenStream) -> TokenStream {
|
||||||
let event_enum_input = syn::parse_macro_input!(input as EventEnumInput);
|
let event_enum_input = syn::parse_macro_input!(input as EventEnumInput);
|
||||||
|
@ -31,6 +31,7 @@ mod util;
|
|||||||
/// of the struct, this simple implementation will be generated:
|
/// of the struct, this simple implementation will be generated:
|
||||||
///
|
///
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
|
/// # // TODO: "ignore" this doctest until it is more extensively documented. (See #541)
|
||||||
/// impl Outgoing for MyType {
|
/// impl Outgoing for MyType {
|
||||||
/// type Incoming = Self;
|
/// type Incoming = Self;
|
||||||
/// }
|
/// }
|
||||||
|
@ -22,7 +22,12 @@ use crate::cow::MyCowStr;
|
|||||||
/// All event structs and enums implement `Serialize` / `Deserialize`, `Raw` should be used
|
/// All event structs and enums implement `Serialize` / `Deserialize`, `Raw` should be used
|
||||||
/// to pass around events in a lossless way.
|
/// to pass around events in a lossless way.
|
||||||
///
|
///
|
||||||
/// ```ignore
|
/// ```no_run
|
||||||
|
/// # use serde::Deserialize;
|
||||||
|
/// # use ruma_serde::Raw;
|
||||||
|
/// # #[derive(Deserialize)]
|
||||||
|
/// # struct AnyRoomEvent;
|
||||||
|
///
|
||||||
/// let json = r#"{ "type": "imagine a full event", "content": {...} }"#;
|
/// let json = r#"{ "type": "imagine a full event", "content": {...} }"#;
|
||||||
///
|
///
|
||||||
/// let deser = serde_json::from_str::<Raw<AnyRoomEvent>>(json)
|
/// let deser = serde_json::from_str::<Raw<AnyRoomEvent>>(json)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user