Skip to content

Enforce README examples testing #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ edition = "2018"
[dependencies]
winapi = { version = "0.3", features = ["winnt", "combaseapi", "oleauto", "roapi", "roerrorapi", "hstring", "winstring", "winerror", "restrictederrorinfo"] }

[dev-dependencies]
doc-comment = "0.3"

[features]
nightly = []
windows-ai = []
Expand Down
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//!
//! ## Example
//! ```
//! # // THIS IS THE SAME CODE THAT IS SHOWN IN README.md
//! # // PLEASE KEEP THEM IN SYNC SO WE CAN RELY ON DOCTESTS!
//! extern crate winrt;
//!
//! use winrt::*; // import various helper types
Expand All @@ -28,12 +26,18 @@

#![allow(dead_code,non_upper_case_globals,non_snake_case)]

#[cfg(doctest)]
#[macro_use]
extern crate doc_comment;
extern crate winapi as w;

#[cfg(doctest)]
doctest!("../README.md");

mod guid;
pub use guid::Guid;

///Represents the trust level of an activatable class (re-export from WinAPI crate)
/// Represents the trust level of an activatable class (re-export from WinAPI crate)
pub type TrustLevel = w::winrt::inspectable::TrustLevel;

// Compared to the DEFINE_GUID macro from winapi, this one creates a private const
Expand Down