summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Erik Rediger <janerik@fnordig.de>2022-12-15 13:15:21 +0100
committerJan-Erik Rediger <janerik@fnordig.de>2022-12-15 13:16:16 +0100
commit2258a47fe5ff8705deeeb83b7f0758b577e7ce3f (patch)
treef918b235a1ea4138d8c4247439383ff63d07a0fe /src
parentb6c00ca429ac2a4ca9ffd5f89ddf6e6a43835731 (diff)
Upgrade dependencies and fix clap breakage
Fixes #30
Diffstat (limited to 'src')
-rw-r--r--src/bin/mdbook-mermaid.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bin/mdbook-mermaid.rs b/src/bin/mdbook-mermaid.rs
index b165c3f..3cac40b 100644
--- a/src/bin/mdbook-mermaid.rs
+++ b/src/bin/mdbook-mermaid.rs
@@ -18,7 +18,7 @@ const MERMAID_FILES: &[(&str, &[u8])] = &[
("mermaid-init.js", MERMAID_INIT_JS),
];
-pub fn make_app() -> Command<'static> {
+pub fn make_app() -> Command {
Command::new("mdbook-mermaid")
.version(crate_version!())
.about("mdbook preprocessor to add mermaid support")
@@ -72,7 +72,7 @@ fn handle_preprocessing() -> Result<(), Error> {
}
fn handle_supports(sub_args: &ArgMatches) -> ! {
- let renderer = sub_args.value_of("renderer").expect("Required argument");
+ let renderer = sub_args.get_one::<String>("renderer").expect("Required argument");
let supported = Mermaid.supports_renderer(renderer);
// Signal whether the renderer is supported by exiting with 1 or 0.
@@ -84,8 +84,7 @@ fn handle_supports(sub_args: &ArgMatches) -> ! {
}
fn handle_install(sub_args: &ArgMatches) -> ! {
- let dir = sub_args.value_of("dir").expect("Required argument");
- let proj_dir = PathBuf::from(dir);
+ let proj_dir = sub_args.get_one::<PathBuf>("dir").expect("Required argument");
let config = proj_dir.join("book.toml");
if !config.exists() {