Formatting.

This commit is contained in:
Mara Bos 2021-01-01 17:31:32 +01:00
parent 4833972067
commit 273d2f9123
2 changed files with 22 additions and 4 deletions

View file

@ -54,8 +54,17 @@ pub(super) fn highlight_injection(
type RangesMap = BTreeMap<TextSize, TextSize>; type RangesMap = BTreeMap<TextSize, TextSize>;
const RUSTDOC_FENCE: &'static str = "```"; const RUSTDOC_FENCE: &'static str = "```";
const RUSTDOC_FENCE_TOKENS: &[&'static str] = const RUSTDOC_FENCE_TOKENS: &[&'static str] = &[
&["", "rust", "should_panic", "ignore", "no_run", "compile_fail", "edition2015", "edition2018", "edition2021"]; "",
"rust",
"should_panic",
"ignore",
"no_run",
"compile_fail",
"edition2015",
"edition2018",
"edition2021",
];
/// Extracts Rust code from documentation comments as well as a mapping from /// Extracts Rust code from documentation comments as well as a mapping from
/// the extracted source code back to the original source ranges. /// the extracted source code back to the original source ranges.

View file

@ -1,8 +1,17 @@
//! Transforms markdown //! Transforms markdown
const RUSTDOC_FENCE: &str = "```"; const RUSTDOC_FENCE: &str = "```";
const RUSTDOC_CODE_BLOCK_ATTRIBUTES_RUST_SPECIFIC: &[&str] = const RUSTDOC_CODE_BLOCK_ATTRIBUTES_RUST_SPECIFIC: &[&str] = &[
&["", "rust", "should_panic", "ignore", "no_run", "compile_fail", "edition2015", "edition2018", "edition2021"]; "",
"rust",
"should_panic",
"ignore",
"no_run",
"compile_fail",
"edition2015",
"edition2018",
"edition2021",
];
pub(crate) fn format_docs(src: &str) -> String { pub(crate) fn format_docs(src: &str) -> String {
let mut processed_lines = Vec::new(); let mut processed_lines = Vec::new();