Skip to content

Commit 3728f06

Browse files
committed
Auto merge of #14772 - hcbarker:issue-14764-fix, r=weihanglo
chore: update handlebars to v6, fix build error `DirectorySourceOptions` is marked as `#[non_exhaustive]`, and only exposes the Default trait, so we need to instantiate a mutable instance using `default()`, and then change `tpl_extension` to the value we want. Fixes #14764
2 parents 0310497 + 9b4f03a commit 3728f06

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ git2 = "0.19.0"
5050
git2-curl = "0.20.0"
5151
gix = { version = "0.67.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
5252
glob = "0.3.1"
53-
handlebars = { version = "5.1.2", features = ["dir_source"] }
53+
handlebars = { version = "6.0.0", features = ["dir_source"] }
5454
hex = "0.4.3"
5555
hmac = "0.12.1"
5656
home = "0.5.9"

crates/mdman/src/hbs.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@ pub fn expand(file: &Path, formatter: FormatterRef<'_>) -> Result<String, Error>
2424
handlebars.register_decorator("set", Box::new(set_decorator));
2525
handlebars.register_template_file("template", file)?;
2626
let includes = file.parent().unwrap().join("includes");
27-
let options = DirectorySourceOptions {
28-
tpl_extension: ".md".to_string(),
29-
hidden: false,
30-
temporary: false,
31-
};
27+
let mut options = DirectorySourceOptions::default();
28+
options.tpl_extension = ".md".to_string();
3229
handlebars.register_templates_directory(includes, options)?;
3330
let man_name = file
3431
.file_stem()

0 commit comments

Comments
 (0)