Skip to content

Commit 42137a2

Browse files
chore: fix Clippy issues for Rust 1.88
1 parent e1f9949 commit 42137a2

8 files changed

Lines changed: 14 additions & 16 deletions

File tree

packages/mdbook-plugin-utils/src/markdown/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ where
4242
let mut nested_level = 0;
4343

4444
for (event, span) in Parser::new(content).into_offset_iter() {
45-
debug!("{:?} {:?}", event, span);
45+
debug!("{event:?} {span:?}");
4646

4747
if is_start(&event) {
4848
if let Some(block) = blocks.last_mut() {

packages/mdbook-tabs/src/parser/tabs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn parse_tabs(chapter: &Chapter) -> Result<(Vec<SpanAndTabs>, bool)> {
4848
let mut configs: Vec<(Range<usize>, TabsConfig)> = vec![];
4949

5050
let blocks = parse_blocks(&chapter.content, is_tabs_start, is_tabs_end, true)?;
51-
debug!("{:?}", blocks);
51+
debug!("{blocks:?}");
5252

5353
for block in &blocks {
5454
let start_text = match &block.events[0].0 {
@@ -70,7 +70,7 @@ pub fn parse_tabs(chapter: &Chapter) -> Result<(Vec<SpanAndTabs>, bool)> {
7070
is_tab_end,
7171
true,
7272
)?;
73-
debug!("{:?}", subblocks);
73+
debug!("{subblocks:?}");
7474

7575
for subblock in subblocks {
7676
let start_text = match &subblock.events[0].0 {
@@ -95,7 +95,7 @@ pub fn parse_tabs(chapter: &Chapter) -> Result<(Vec<SpanAndTabs>, bool)> {
9595
configs.push((block.span.clone(), tabs));
9696
}
9797

98-
debug!("{:?}", configs);
98+
debug!("{configs:?}");
9999

100100
Ok((configs, blocks.iter().any(|block| block.has_nested)))
101101
}

packages/mdbook-tabs/src/tabs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub fn tabs(config: &TabsConfig) -> String {
66
config
77
.global
88
.as_ref()
9-
.map(|global| format!(" data-tabglobal=\"{}\"", global))
9+
.map(|global| format!(" data-tabglobal=\"{global}\""))
1010
.unwrap_or("".to_string()),
1111
config
1212
.tabs

packages/mdbook-trunk/src/bin/mdbook-trunk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn handle_combine() -> Result<()> {
7676
let dest_dir = book.root.join("dist");
7777
let dest_dir_str = dest_dir.to_str().unwrap();
7878

79-
log::info!("Combining into directory `{}`.", dest_dir_str);
79+
log::info!("Combining into directory `{dest_dir_str}`.");
8080

8181
if dest_dir.exists() {
8282
log::info!("Directory exists, recreating.");
@@ -92,7 +92,7 @@ fn handle_combine() -> Result<()> {
9292
continue;
9393
}
9494

95-
log::info!("Adding directory `{}`.", directory);
95+
log::info!("Adding directory `{directory}`.");
9696
copy(
9797
build_dir.join(directory),
9898
&dest_dir,

packages/mdbook-trunk/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl Config {
5454
}
5555

5656
pub fn parse_from_toml(content: &str) -> Result<Self, toml::de::Error> {
57-
log::debug!("{:?}", content);
57+
log::debug!("{content:?}");
5858
toml::from_str(content)
5959
}
6060

packages/mdbook-trunk/src/parser/definition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ pub fn parse_definitions(chapter: &Chapter) -> Result<Vec<(Range<usize>, Config)
1515
let mut configs: Vec<(Range<usize>, Config)> = vec![];
1616

1717
let blocks = parse_code_blocks(&chapter.content, is_tags)?;
18-
debug!("{:?}", blocks);
18+
debug!("{blocks:?}");
1919

2020
for block in blocks {
2121
let config = Config::parse_from_toml(&chapter.content[block.inner_span.clone()])?;
2222
configs.push((block.span, config));
2323
}
2424

25-
debug!("{:?}", configs);
25+
debug!("{configs:?}");
2626

2727
Ok(configs)
2828
}

packages/mdbook-trunk/src/parser/iframe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn parse_iframes(chapter: &Chapter) -> Result<Vec<(Range<usize>, Config)>> {
2525
let mut configs: Vec<(Range<usize>, Config)> = vec![];
2626

2727
let blocks = parse_blocks(&chapter.content, is_iframe_start, is_iframe_end, false)?;
28-
debug!("{:?}", blocks);
28+
debug!("{blocks:?}");
2929

3030
for block in blocks {
3131
let dom = Dom::parse(&chapter.content[block.span.clone()])?;
@@ -53,7 +53,7 @@ pub fn parse_iframes(chapter: &Chapter) -> Result<Vec<(Range<usize>, Config)>> {
5353
configs.push((block.span, config));
5454
}
5555

56-
debug!("{:?}", configs);
56+
debug!("{configs:?}");
5757

5858
Ok(configs)
5959
}

packages/mdbook-trunk/src/trunk.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ fn files(workspace: &Workspace, config: &Config) -> Result<String> {
8585

8686
header_elements.push(format!(
8787
"<button class=\"mdbook-trunk-file{}\" data-file=\"{}\">{}</button>",
88-
(config.show_files.unwrap_or(false) && index == 0)
89-
.then_some(" active")
90-
.unwrap_or_default(),
88+
if config.show_files.unwrap_or(false) && index == 0 { " active" } else { Default::default() },
9189
file,
9290
file_path
9391
.file_name()
@@ -97,7 +95,7 @@ fn files(workspace: &Workspace, config: &Config) -> Result<String> {
9795

9896
content_elements.push(format!(
9997
"<div class=\"mdbook-trunk-file-content{}\" data-file=\"{}\">\n\n```{}\n{}\n```\n\n</div>",
100-
(!(config.show_files.unwrap_or(false) && index == 0)).then_some(" hidden").unwrap_or_default(),
98+
if !(config.show_files.unwrap_or(false) && index == 0) { " hidden" } else { Default::default() },
10199
file,
102100
language,
103101
content

0 commit comments

Comments
 (0)