Skip to content

Commit 6bc0052

Browse files
committed
Enable Rustfmt option format_code_in_doc_comments
1 parent eb6e84f commit 6bc0052

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
format_code_in_doc_comments = true
12
group_imports = "StdExternalCrate"
23
imports_granularity = "Crate"
34
normalize_comments = true

spdlog/src/kv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ enum KeyValuesIterInner<'a> {
161161
///
162162
/// ```
163163
/// use std::fmt::Write;
164+
///
164165
/// use spdlog::{
165166
/// formatter::{Formatter, FormatterContext},
166167
/// Record, StringBuf,

spdlog/src/logger.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,8 @@ impl Logger {
377377
/// ```
378378
/// use spdlog::prelude::*;
379379
///
380-
/// spdlog::default_logger().set_error_handler(|err| {
381-
/// panic!("An error occurred in the default logger: {}", err)
382-
/// });
380+
/// spdlog::default_logger()
381+
/// .set_error_handler(|err| panic!("An error occurred in the default logger: {}", err));
383382
/// ```
384383
pub fn set_error_handler<F: Into<ErrorHandler>>(&self, handler: F) {
385384
*self.error_handler.write_expect() = handler.into();

spdlog/src/sink/rotating_file_sink.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ use crate::{
4141
/// RotationPolicy::FileSize(1024 * 1024 * 10);
4242
///
4343
/// // Rotating every day at 15:30.
44-
/// RotationPolicy::Daily { hour: 15, minute: 30 };
44+
/// RotationPolicy::Daily {
45+
/// hour: 15,
46+
/// minute: 30,
47+
/// };
4548
///
4649
/// // Rotating every hour.
4750
/// RotationPolicy::Hourly;

spdlog/src/source_location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl SourceLocation {
108108
/// # Examples
109109
///
110110
/// ```
111-
/// use spdlog::{SourceLocation, source_location_current};
111+
/// use spdlog::{source_location_current, SourceLocation};
112112
///
113113
/// let source_location: Option<SourceLocation> = source_location_current!();
114114
/// ```

0 commit comments

Comments
 (0)