diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index b93fd214..a32db5f2 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -42,7 +42,7 @@ //! #![cfg_attr( feature = "repo", - doc = r##"## `vergen` - Test git repositories (`repo` feature) + doc = r"## `vergen` - Test git repositories (`repo` feature) If you enable the `repo` feature of `test_util` you can also use the [`TestRepos`] struct to creat temporary git repositories useful for `vergen-gi*` testing @@ -65,7 +65,7 @@ the [`TestRepos`] struct to creat temporary git repositories useful for `vergen- # Ok(()) # } ``` -"## +" )] // rustc lints #![cfg_attr( diff --git a/vergen-git2/src/lib.rs b/vergen-git2/src/lib.rs index 96a747e5..59ddc632 100644 --- a/vergen-git2/src/lib.rs +++ b/vergen-git2/src/lib.rs @@ -60,44 +60,35 @@ //! ``` //! # use anyhow::Result; //! # use vergen_git2::{Emitter, Git2Builder}; -#![cfg_attr(feature = "build", doc = r##"# use vergen_git2::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen_git2::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen_git2::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen_git2::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen_git2::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen_git2::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen_git2::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen_git2::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] //! // NOTE: This will output everything, and requires all features enabled. //! // NOTE: See the specific builder documentation for configuration options. -#![cfg_attr( - feature = "build", - doc = r##"let build = BuildBuilder::all_build()?;"## -)] -#![cfg_attr( - feature = "cargo", - doc = r##"let cargo = CargoBuilder::all_cargo()?;"## -)] +#![cfg_attr(feature = "build", doc = r"let build = BuildBuilder::all_build()?;")] +#![cfg_attr(feature = "cargo", doc = r"let cargo = CargoBuilder::all_cargo()?;")] //! let git2 = Git2Builder::all_git()?; -#![cfg_attr( - feature = "rustc", - doc = r##"let rustc = RustcBuilder::all_rustc()?;"## -)] -#![cfg_attr(feature = "si", doc = r##"let si = SysinfoBuilder::all_sysinfo()?;"##)] +#![cfg_attr(feature = "rustc", doc = r"let rustc = RustcBuilder::all_rustc()?;")] +#![cfg_attr(feature = "si", doc = r"let si = SysinfoBuilder::all_sysinfo()?;")] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] //! .add_instructions(&git2)? -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } @@ -147,47 +138,47 @@ //! ``` //! # use anyhow::Result; //! # use vergen_git2::{Emitter, Git2Builder}; -#![cfg_attr(feature = "build", doc = r##"# use vergen_git2::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen_git2::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen_git2::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen_git2::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen_git2::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen_git2::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen_git2::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen_git2::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] #![cfg_attr( feature = "build", - doc = r##"// NOTE: This will output only the instructions specified. + doc = r"// NOTE: This will output only the instructions specified. // NOTE: See the specific builder documentation for configuration options. -let build = BuildBuilder::default().build_timestamp(true).build()?;"## +let build = BuildBuilder::default().build_timestamp(true).build()?;" )] #![cfg_attr( feature = "cargo", - doc = r##"let cargo = CargoBuilder::default().opt_level(true).build()?;"## + doc = r"let cargo = CargoBuilder::default().opt_level(true).build()?;" )] //! let git2 = Git2Builder::default().commit_timestamp(true).build()?; #![cfg_attr( feature = "rustc", - doc = r##"let rustc = RustcBuilder::default().semver(true).build()?;"## + doc = r"let rustc = RustcBuilder::default().semver(true).build()?;" )] #![cfg_attr( feature = "si", - doc = r##"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;"## + doc = r"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;" )] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] //! .add_instructions(&git2)? -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } diff --git a/vergen-gitcl/src/lib.rs b/vergen-gitcl/src/lib.rs index e2a14c77..432ceb9f 100644 --- a/vergen-gitcl/src/lib.rs +++ b/vergen-gitcl/src/lib.rs @@ -60,44 +60,35 @@ //! ``` //! # use anyhow::Result; //! # use vergen_gitcl::{Emitter, GitclBuilder}; -#![cfg_attr(feature = "build", doc = r##"# use vergen_gitcl::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen_gitcl::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen_gitcl::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen_gitcl::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen_gitcl::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen_gitcl::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen_gitcl::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen_gitcl::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] //! // NOTE: This will output everything, and requires all features enabled. //! // NOTE: See the specific builder documentation for configuration options. -#![cfg_attr( - feature = "build", - doc = r##"let build = BuildBuilder::all_build()?;"## -)] -#![cfg_attr( - feature = "cargo", - doc = r##"let cargo = CargoBuilder::all_cargo()?;"## -)] +#![cfg_attr(feature = "build", doc = r"let build = BuildBuilder::all_build()?;")] +#![cfg_attr(feature = "cargo", doc = r"let cargo = CargoBuilder::all_cargo()?;")] //! let gitcl = GitclBuilder::all_git()?; -#![cfg_attr( - feature = "rustc", - doc = r##"let rustc = RustcBuilder::all_rustc()?;"## -)] -#![cfg_attr(feature = "si", doc = r##"let si = SysinfoBuilder::all_sysinfo()?;"##)] +#![cfg_attr(feature = "rustc", doc = r"let rustc = RustcBuilder::all_rustc()?;")] +#![cfg_attr(feature = "si", doc = r"let si = SysinfoBuilder::all_sysinfo()?;")] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] //! .add_instructions(&gitcl)? -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } @@ -147,47 +138,47 @@ //! ``` //! # use anyhow::Result; //! # use vergen_gitcl::{Emitter, GitclBuilder}; -#![cfg_attr(feature = "build", doc = r##"# use vergen_gitcl::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen_gitcl::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen_gitcl::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen_gitcl::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen_gitcl::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen_gitcl::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen_gitcl::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen_gitcl::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] #![cfg_attr( feature = "build", - doc = r##"// NOTE: This will output only the instructions specified. + doc = r"// NOTE: This will output only the instructions specified. // NOTE: See the specific builder documentation for configuration options. -let build = BuildBuilder::default().build_timestamp(true).build()?;"## +let build = BuildBuilder::default().build_timestamp(true).build()?;" )] #![cfg_attr( feature = "cargo", - doc = r##"let cargo = CargoBuilder::default().opt_level(true).build()?;"## + doc = r"let cargo = CargoBuilder::default().opt_level(true).build()?;" )] //! let gitcl = GitclBuilder::default().commit_timestamp(true).build()?; #![cfg_attr( feature = "rustc", - doc = r##"let rustc = RustcBuilder::default().semver(true).build()?;"## + doc = r"let rustc = RustcBuilder::default().semver(true).build()?;" )] #![cfg_attr( feature = "si", - doc = r##"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;"## + doc = r"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;" )] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] //! .add_instructions(&gitcl)? -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } diff --git a/vergen-gix/src/lib.rs b/vergen-gix/src/lib.rs index 55cbddcf..15973d74 100644 --- a/vergen-gix/src/lib.rs +++ b/vergen-gix/src/lib.rs @@ -60,44 +60,35 @@ //! ``` //! # use anyhow::Result; //! # use vergen_gix::{Emitter, GixBuilder}; -#![cfg_attr(feature = "build", doc = r##"# use vergen_gix::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen_gix::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen_gix::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen_gix::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen_gix::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen_gix::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen_gix::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen_gix::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] //! // NOTE: This will output everything, and requires all features enabled. //! // NOTE: See the specific builder documentation for configuration options. -#![cfg_attr( - feature = "build", - doc = r##"let build = BuildBuilder::all_build()?;"## -)] -#![cfg_attr( - feature = "cargo", - doc = r##"let cargo = CargoBuilder::all_cargo()?;"## -)] +#![cfg_attr(feature = "build", doc = r"let build = BuildBuilder::all_build()?;")] +#![cfg_attr(feature = "cargo", doc = r"let cargo = CargoBuilder::all_cargo()?;")] //! let gitcl = GixBuilder::all_git()?; -#![cfg_attr( - feature = "rustc", - doc = r##"let rustc = RustcBuilder::all_rustc()?;"## -)] -#![cfg_attr(feature = "si", doc = r##"let si = SysinfoBuilder::all_sysinfo()?;"##)] +#![cfg_attr(feature = "rustc", doc = r"let rustc = RustcBuilder::all_rustc()?;")] +#![cfg_attr(feature = "si", doc = r"let si = SysinfoBuilder::all_sysinfo()?;")] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] //! .add_instructions(&gitcl)? -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } @@ -147,47 +138,47 @@ //! ``` //! # use anyhow::Result; //! # use vergen_gix::{Emitter, GixBuilder}; -#![cfg_attr(feature = "build", doc = r##"# use vergen_gix::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen_gix::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen_gix::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen_gix::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen_gix::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen_gix::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen_gix::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen_gix::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] #![cfg_attr( feature = "build", - doc = r##"// NOTE: This will output only the instructions specified. + doc = r"// NOTE: This will output only the instructions specified. // NOTE: See the specific builder documentation for configuration options. -let build = BuildBuilder::default().build_timestamp(true).build()?;"## +let build = BuildBuilder::default().build_timestamp(true).build()?;" )] #![cfg_attr( feature = "cargo", - doc = r##"let cargo = CargoBuilder::default().opt_level(true).build()?;"## + doc = r"let cargo = CargoBuilder::default().opt_level(true).build()?;" )] //! let gitcl = GixBuilder::default().commit_timestamp(true).build()?; #![cfg_attr( feature = "rustc", - doc = r##"let rustc = RustcBuilder::default().semver(true).build()?;"## + doc = r"let rustc = RustcBuilder::default().semver(true).build()?;" )] #![cfg_attr( feature = "si", - doc = r##"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;"## + doc = r"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;" )] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] //! .add_instructions(&gitcl)? -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } diff --git a/vergen-lib/src/utils.rs b/vergen-lib/src/utils.rs index 9c5a98e9..02da500a 100644 --- a/vergen-lib/src/utils.rs +++ b/vergen-lib/src/utils.rs @@ -14,9 +14,9 @@ use std::env; /// let mut warning: CargoWarning = vec![]; #[cfg_attr( feature = "build", - doc = r##" add_default_map_entry(VergenKey::BuildDate, &mut map, &mut warning); + doc = r" add_default_map_entry(VergenKey::BuildDate, &mut map, &mut warning); assert_eq!(1, map.len()); -assert_eq!(1, warning.len());"## +assert_eq!(1, warning.len());" )] /// }); /// ``` @@ -44,8 +44,8 @@ pub fn add_default_map_entry( /// let mut map: CargoRustcEnvMap = BTreeMap::new(); #[cfg_attr( feature = "build", - doc = r##"add_map_entry(VergenKey::BuildDate, "test", &mut map); -assert_eq!(1, map.len());"## + doc = r#"add_map_entry(VergenKey::BuildDate, "test", &mut map); +assert_eq!(1, map.len());"# )] /// ``` /// @@ -70,9 +70,9 @@ where /// assert_eq!(0, count_idempotent(&map)); #[cfg_attr( feature = "build", - doc = r##"_ = map.insert(VergenKey::BuildDate, VERGEN_IDEMPOTENT_DEFAULT.to_string());"## + doc = r"_ = map.insert(VergenKey::BuildDate, VERGEN_IDEMPOTENT_DEFAULT.to_string());" )] -#[cfg_attr(feature = "build", doc = r##"assert_eq!(1, count_idempotent(&map));"##)] +#[cfg_attr(feature = "build", doc = r"assert_eq!(1, count_idempotent(&map));")] /// ``` /// #[must_use] diff --git a/vergen-pretty/src/header/mod.rs b/vergen-pretty/src/header/mod.rs index 057e475c..cd0757cf 100644 --- a/vergen-pretty/src/header/mod.rs +++ b/vergen-pretty/src/header/mod.rs @@ -40,12 +40,12 @@ pub type Env = BTreeMap<&'static str, Option<&'static str>>; /// ``` /// # use anyhow::Result; /// # use vergen_pretty::{ConfigBuilder, header, vergen_pretty_env}; -#[cfg_attr(feature = "color", doc = r##"use vergen_pretty::Style;"##)] +#[cfg_attr(feature = "color", doc = r"use vergen_pretty::Style;")] /// # /// # pub fn main() -> Result<()> { /// let mut buf = vec![]; /// let config = ConfigBuilder::default() -#[cfg_attr(feature = "color", doc = r##" .style(Style::new().green())"##)] +#[cfg_attr(feature = "color", doc = r" .style(Style::new().green())")] /// .prefix("HEADER_PREFIX") /// .env(vergen_pretty_env!()) /// .suffix("HEADER_SUFFIX") diff --git a/vergen-pretty/src/lib.rs b/vergen-pretty/src/lib.rs index c90e575b..27d6cf81 100644 --- a/vergen-pretty/src/lib.rs +++ b/vergen-pretty/src/lib.rs @@ -52,30 +52,30 @@ //! #![cfg_attr( feature = "header", - doc = r##"If you enable the header feature, you can also use the [`header()`] function + doc = r"If you enable the header feature, you can also use the [`header()`] function with the associated [`Config`] as a convenience wrapper around [`Pretty`]. # Example ``` # use anyhow::Result; -# use vergen_pretty::{ConfigBuilder, header, vergen_pretty_env};"## +# use vergen_pretty::{ConfigBuilder, header, vergen_pretty_env};" )] -#![cfg_attr(feature = "color", doc = r##"# use vergen_pretty::Style;"##)] +#![cfg_attr(feature = "color", doc = r"# use vergen_pretty::Style;")] #![cfg_attr( feature = "header", - doc = r##" + doc = r" # # pub fn main() -> Result<()> { let mut buf = vec![]; -let config = ConfigBuilder::default()"## +let config = ConfigBuilder::default()" )] #![cfg_attr( all(feature = "color", feature = "header"), - doc = r##" .style(Style::new().green())"## + doc = r" .style(Style::new().green())" )] #![cfg_attr( feature = "header", - doc = r##" + doc = r#" .prefix("HEADER_PREFIX") .env(vergen_pretty_env!()) .suffix("HEADER_SUFFIX") @@ -85,7 +85,7 @@ assert!(!buf.is_empty()); # Ok(()) # } ``` -"## +"# )] //! //! ## Features diff --git a/vergen-pretty/src/pretty/mod.rs b/vergen-pretty/src/pretty/mod.rs index 0673a512..eabd5566 100644 --- a/vergen-pretty/src/pretty/mod.rs +++ b/vergen-pretty/src/pretty/mod.rs @@ -41,7 +41,7 @@ pub(crate) mod suffix; /// #[cfg_attr( feature = "trace", - doc = r##" + doc = r" # Trace Generate [`tracing`] output @@ -58,7 +58,7 @@ PrettyBuilder::default() # Ok(()) # } ``` -"## +" )] /// /// # Output a prefix/suffix @@ -94,7 +94,7 @@ PrettyBuilder::default() /// #[cfg_attr( feature = "color", - doc = r##" + doc = r" # Customize Colorized Output Uses [`Style`](console::Style) to colorize output @@ -116,7 +116,7 @@ PrettyBuilder::default() # Ok(()) # } ``` -"## +" )] /// #[derive(Builder, Clone, Debug, PartialEq)] diff --git a/vergen/src/lib.rs b/vergen/src/lib.rs index d580e317..edb1cc4b 100644 --- a/vergen/src/lib.rs +++ b/vergen/src/lib.rs @@ -55,42 +55,33 @@ //! ``` //! # use anyhow::Result; //! # use vergen::Emitter; -#![cfg_attr(feature = "build", doc = r##"# use vergen::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] //! // NOTE: This will output everything, and requires all features enabled. //! // NOTE: See the specific builder documentation for configuration options. -#![cfg_attr( - feature = "build", - doc = r##"let build = BuildBuilder::all_build()?;"## -)] -#![cfg_attr( - feature = "cargo", - doc = r##"let cargo = CargoBuilder::all_cargo()?;"## -)] -#![cfg_attr( - feature = "rustc", - doc = r##"let rustc = RustcBuilder::all_rustc()?;"## -)] -#![cfg_attr(feature = "si", doc = r##"let si = SysinfoBuilder::all_sysinfo()?;"##)] +#![cfg_attr(feature = "build", doc = r"let build = BuildBuilder::all_build()?;")] +#![cfg_attr(feature = "cargo", doc = r"let cargo = CargoBuilder::all_cargo()?;")] +#![cfg_attr(feature = "rustc", doc = r"let rustc = RustcBuilder::all_rustc()?;")] +#![cfg_attr(feature = "si", doc = r"let si = SysinfoBuilder::all_sysinfo()?;")] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } @@ -129,45 +120,45 @@ //! ``` //! # use anyhow::Result; //! # use vergen::Emitter; -#![cfg_attr(feature = "build", doc = r##"# use vergen::BuildBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use vergen::CargoBuilder;"##)] -#![cfg_attr(feature = "rustc", doc = r##"# use vergen::RustcBuilder;"##)] -#![cfg_attr(feature = "si", doc = r##"# use vergen::SysinfoBuilder;"##)] -#![cfg_attr(feature = "cargo", doc = r##"# use test_util::with_cargo_vars;"##)] +#![cfg_attr(feature = "build", doc = r"# use vergen::BuildBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use vergen::CargoBuilder;")] +#![cfg_attr(feature = "rustc", doc = r"# use vergen::RustcBuilder;")] +#![cfg_attr(feature = "si", doc = r"# use vergen::SysinfoBuilder;")] +#![cfg_attr(feature = "cargo", doc = r"# use test_util::with_cargo_vars;")] //! # //! # pub fn main() -> Result<()> { -#![cfg_attr(feature = "cargo", doc = r##"# let result = with_cargo_vars(|| {"##)] +#![cfg_attr(feature = "cargo", doc = r"# let result = with_cargo_vars(|| {")] #![cfg_attr( feature = "build", - doc = r##"// NOTE: This will output only the instructions specified. + doc = r"// NOTE: This will output only the instructions specified. // NOTE: See the specific builder documentation for configuration options. -let build = BuildBuilder::default().build_timestamp(true).build()?;"## +let build = BuildBuilder::default().build_timestamp(true).build()?;" )] #![cfg_attr( feature = "cargo", - doc = r##"let cargo = CargoBuilder::default().opt_level(true).build()?;"## + doc = r"let cargo = CargoBuilder::default().opt_level(true).build()?;" )] #![cfg_attr( feature = "rustc", - doc = r##"let rustc = RustcBuilder::default().semver(true).build()?;"## + doc = r"let rustc = RustcBuilder::default().semver(true).build()?;" )] #![cfg_attr( feature = "si", - doc = r##"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;"## + doc = r"let si = SysinfoBuilder::default().cpu_core_count(true).build()?;" )] //! //! Emitter::default() -#![cfg_attr(feature = "build", doc = r##" .add_instructions(&build)?"##)] -#![cfg_attr(feature = "cargo", doc = r##" .add_instructions(&cargo)?"##)] -#![cfg_attr(feature = "rustc", doc = r##" .add_instructions(&rustc)?"##)] -#![cfg_attr(feature = "si", doc = r##" .add_instructions(&si)?"##)] +#![cfg_attr(feature = "build", doc = r" .add_instructions(&build)?")] +#![cfg_attr(feature = "cargo", doc = r" .add_instructions(&cargo)?")] +#![cfg_attr(feature = "rustc", doc = r" .add_instructions(&rustc)?")] +#![cfg_attr(feature = "si", doc = r" .add_instructions(&si)?")] //! .emit()?; #![cfg_attr( feature = "cargo", - doc = r##" + doc = r" # Ok(()) # }); -# assert!(result.is_ok());"## +# assert!(result.is_ok());" )] //! # Ok(()) //! # } @@ -199,7 +190,7 @@ let build = BuildBuilder::default().build_timestamp(true).build()?;"## //! You **must** specifically enable the features you wish to use. #![cfg_attr( feature = "emit_and_set", - doc = r##"There is also a toggle for the [`emit_and_set`](Emitter::emit_and_set) function. This version of emit will also set the instructions you requests as environment variables for use in `build.rs`"## + doc = r"There is also a toggle for the [`emit_and_set`](Emitter::emit_and_set) function. This version of emit will also set the instructions you requests as environment variables for use in `build.rs`" )] //! //! | Feature | Enables | @@ -210,7 +201,7 @@ let build = BuildBuilder::default().build_timestamp(true).build()?;"## //! | si | `VERGEN_SYSINFO_*` instructions | #![cfg_attr( feature = "emit_and_set", - doc = r##"| emit_and_set | Enable the [`emit_and_set`](Emitter::emit_and_set) function |"## + doc = r"| emit_and_set | Enable the [`emit_and_set`](Emitter::emit_and_set) function |" )] //! //! ## Environment Variables