diff --git a/CHANGELOG.md b/CHANGELOG.md index 60870804a..45a18cdda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log ## [Unreleased] +* Migrate to 2021 edition and minor cleanups by @nyurik in https://github.com/rust-lang/log/pull/580 +* Use inline format args by @nyurik in https://github.com/rust-lang/log/pull/577 ## [0.4.20] - 2023-07-11 diff --git a/src/lib.rs b/src/lib.rs index 2545e9b8c..bb464f90c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,7 +48,7 @@ //! //! ### Examples //! -//! ```edition2021 +//! ``` //! # #[derive(Debug)] pub struct Yak(String); //! # impl Yak { fn shave(&mut self, _: u32) {} } //! # fn find_a_razor() -> Result { Ok(1) } @@ -92,7 +92,7 @@ //! with your log records. If we take the example from before, we can include //! some additional context besides what's in the formatted message: //! -//! ```edition2021 +//! ``` //! # use serde::Serialize; //! # #[derive(Debug, Serialize)] pub struct Yak(String); //! # impl Yak { fn shave(&mut self, _: u32) {} } @@ -160,7 +160,7 @@ //! logs all messages at the [`Error`][level_link], [`Warn`][level_link] or //! [`Info`][level_link] levels to stdout: //! -//! ```edition2021 +//! ``` //! use log::{Record, Level, Metadata}; //! //! struct SimpleLogger; @@ -193,7 +193,7 @@ //! provide a function that wraps a call to [`set_logger`] and //! [`set_max_level`], handling initialization of the logger: //! -//! ```edition2021 +//! ``` //! # use log::{Level, Metadata}; //! # struct SimpleLogger; //! # impl log::Log for SimpleLogger { @@ -223,7 +223,7 @@ //! identical to `set_logger` except that it takes a `Box` rather than a //! `&'static Log`: //! -//! ```edition2021 +//! ``` //! # use log::{Level, LevelFilter, Log, SetLoggerError, Metadata}; //! # struct SimpleLogger; //! # impl log::Log for SimpleLogger { @@ -688,7 +688,7 @@ impl<'a> MaybeStaticStr<'a> { /// The following example shows a simple logger that displays the level, /// module path, and message of any `Record` that is passed to it. /// -/// ```edition2021 +/// ``` /// struct SimpleLogger; /// /// impl log::Log for SimpleLogger { @@ -845,7 +845,7 @@ impl<'a> Record<'a> { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::{Level, Record}; /// /// let record = Record::builder() @@ -860,7 +860,7 @@ impl<'a> Record<'a> { /// /// Alternatively, use [`MetadataBuilder`](struct.MetadataBuilder.html): /// -/// ```edition2021 +/// ``` /// use log::{Record, Level, MetadataBuilder}; /// /// let error_metadata = MetadataBuilder::new() @@ -1011,7 +1011,7 @@ impl<'a> Default for RecordBuilder<'a> { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::{Record, Level, Metadata}; /// /// struct MyLogger; @@ -1065,7 +1065,7 @@ impl<'a> Metadata<'a> { /// /// # Example /// -/// ```edition2021 +/// ``` /// let target = "myApp"; /// use log::{Level, MetadataBuilder}; /// let metadata = MetadataBuilder::new() @@ -1315,7 +1315,7 @@ pub fn set_boxed_logger(logger: Box) -> Result<(), SetLoggerError> { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::{error, info, warn, Record, Level, Metadata, LevelFilter}; /// /// static MY_LOGGER: MyLogger = MyLogger; diff --git a/src/macros.rs b/src/macros.rs index 549827cbf..44945f0d9 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -15,7 +15,7 @@ /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::{log, Level}; /// /// # fn main() { @@ -65,7 +65,7 @@ macro_rules! log { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::error; /// /// # fn main() { @@ -89,7 +89,7 @@ macro_rules! error { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::warn; /// /// # fn main() { @@ -113,7 +113,7 @@ macro_rules! warn { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::info; /// /// # fn main() { @@ -139,7 +139,7 @@ macro_rules! info { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::debug; /// /// # fn main() { @@ -164,7 +164,7 @@ macro_rules! debug { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::trace; /// /// # fn main() { @@ -195,7 +195,7 @@ macro_rules! trace { /// /// # Examples /// -/// ```edition2021 +/// ``` /// use log::Level::Debug; /// use log::{debug, log_enabled}; ///