Skip to content

Commit 71437e6

Browse files
committed
Use a builder pattern for public structs, for future-proofing
1 parent af202d3 commit 71437e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1066
-1069
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ path = "benches/bench.rs"
1818
harness = false
1919

2020
[dependencies]
21+
derive_builder = "0.12.0"
2122
log = "0.4"
2223
unicode-id = { version = "0.3", features = ["no_std"] }
2324

examples/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ fn main() -> Result<(), String> {
1111
"{:?}",
1212
markdown::to_html_with_options(
1313
"<div style=\"color: tomato\">\n\n# Hello, tomato!\n\n</div>",
14-
&markdown::Options {
15-
compile: markdown::CompileOptions {
16-
allow_dangerous_html: true,
17-
allow_dangerous_protocol: true,
18-
..markdown::CompileOptions::default()
19-
},
20-
..markdown::Options::default()
21-
}
14+
&markdown::OptionsBuilder::default()
15+
.compile(
16+
markdown::CompileOptionsBuilder::default()
17+
.allow_dangerous_html(true)
18+
.allow_dangerous_protocol(true)
19+
.build()
20+
)
21+
.build()
2222
)
2323
);
2424

0 commit comments

Comments
 (0)