Skip to content

Commit 0af610b

Browse files
chore: update to Rust edition 2024
1 parent c8bf1b4 commit 0af610b

File tree

16 files changed

+1147
-670
lines changed

16 files changed

+1147
-670
lines changed

Cargo.lock

Lines changed: 1121 additions & 647 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44

55
[workspace.package]
66
authors = ["Rust For Web <[email protected]>"]
7-
edition = "2021"
7+
edition = "2024"
88
license = "MIT"
99
repository = "https://github.com/RustForWeb/mdbook-plugins"
1010
version = "0.2.1"
@@ -14,7 +14,7 @@ anyhow = "1.0.86"
1414
clap = { version = "4.5.8", features = ["derive"] }
1515
env_logger = "0.11.3"
1616
log = "0.4.22"
17-
mdbook = "0.4.40"
17+
mdbook = "0.4.43"
1818
pulldown-cmark = "0.13.0"
1919
semver = "1.0.23"
2020
serde = { version = "1.0.204", features = ["derive"] }

book/book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ additional-js = ["theme/tabs.js", "theme/trunk.js"]
1818
[output.trunk]
1919
command = "cargo run -p mdbook-trunk"
2020
serve = true
21+
22+
[rust]
23+
edition = "2024"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::ops::Range;
22

3-
use anyhow::{bail, Result};
3+
use anyhow::{Result, bail};
44
use log::debug;
55
use pulldown_cmark::{Event, Parser};
66

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
22
use pulldown_cmark::{CodeBlockKind, Event, Tag, TagEnd};
33

4-
use crate::markdown::block::{parse_blocks, Block};
4+
use crate::markdown::block::{Block, parse_blocks};
55

66
fn is_code_block_start<IsTagsFn>(is_tags: IsTagsFn) -> Box<dyn Fn(&Event) -> bool>
77
where

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ use std::{
33
io::{self, Read},
44
};
55

6-
use anyhow::{anyhow, Result};
6+
use anyhow::{Result, anyhow};
77
use clap::{Args, Parser, Subcommand};
88
use log::warn;
99
use mdbook::{
10-
preprocess::{CmdPreprocessor, Preprocessor},
1110
MDBook,
11+
preprocess::{CmdPreprocessor, Preprocessor},
1212
};
1313
use mdbook_tabs::TabsPreprocessor;
1414
use semver::{Version, VersionReq};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::ops::Range;
22

3-
use anyhow::{bail, Result};
3+
use anyhow::{Result, bail};
44
use log::debug;
55
use mdbook::book::Chapter;
66
use mdbook_plugin_utils::markdown::parse_blocks;

packages/mdbook-tabs/src/preprocessor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use std::str;
22

3-
use anyhow::{bail, Result};
3+
use anyhow::{Result, bail};
44
use mdbook::{
5+
BookItem,
56
book::Book,
67
preprocess::{Preprocessor, PreprocessorContext},
7-
BookItem,
88
};
99

1010
use crate::{parser::tabs::parse_tabs, tabs::tabs};

packages/mdbook-tabs/src/tabs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn tabs(config: &TabsConfig) -> String {
1616
"<button class=\"mdbook-tab{}\" data-tabname=\"{}\">{}</button>",
1717
match index == 0 {
1818
true => " active",
19-
false => ""
19+
false => "",
2020
},
2121
tab.name,
2222
tab.name
@@ -31,7 +31,7 @@ pub fn tabs(config: &TabsConfig) -> String {
3131
"<div class=\"mdbook-tab-content{}\" data-tabname=\"{}\">\n\n{}\n\n</div>",
3232
match index == 0 {
3333
true => "",
34-
false => " hidden"
34+
false => " hidden",
3535
},
3636
tab.name,
3737
tab_content

packages/mdbook-trunk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version.workspace = true
1111

1212
[dependencies]
1313
anyhow.workspace = true
14-
cargo = { version = "0.86.0", features = ["all-static"] }
14+
cargo = { version = "0.87.0", features = ["all-static"] }
1515
clap.workspace = true
1616
env_logger.workspace = true
1717
fs_extra = "1.3.0"

0 commit comments

Comments
 (0)