Skip to content

Commit 0d4c4f6

Browse files
committed
update visibility of items related to markdown code block formatting
The visibility of several private items in comments.rs were updated to `pub(crate)`. These items will help when adding support for formatting rust code blocks in markdown files.
1 parent 6752286 commit 0d4c4f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/comment.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ fn identify_comment(
410410
}
411411

412412
/// Enum indicating if the code block contains rust based on attributes
413-
enum CodeBlockAttribute {
413+
pub(crate) enum CodeBlockAttribute {
414414
Rust,
415415
NotRust,
416416
}
@@ -419,7 +419,7 @@ impl CodeBlockAttribute {
419419
/// Parse comma separated attributes list. Return rust only if all
420420
/// attributes are valid rust attributes
421421
/// See <https://doc.rust-lang.org/rustdoc/print.html#attributes>
422-
fn new(attributes: &str) -> CodeBlockAttribute {
422+
pub(crate) fn new(attributes: &str) -> CodeBlockAttribute {
423423
for attribute in attributes.split(',') {
424424
match attribute.trim() {
425425
"" | "rust" | "should_panic" | "no_run" | "edition2015" | "edition2018"
@@ -954,7 +954,7 @@ fn rewrite_comment_inner(
954954

955955
const RUSTFMT_CUSTOM_COMMENT_PREFIX: &str = "//#### ";
956956

957-
fn hide_sharp_behind_comment(s: &str) -> Cow<'_, str> {
957+
pub(crate) fn hide_sharp_behind_comment(s: &str) -> Cow<'_, str> {
958958
let s_trimmed = s.trim();
959959
if s_trimmed.starts_with("# ") || s_trimmed == "#" {
960960
Cow::from(format!("{RUSTFMT_CUSTOM_COMMENT_PREFIX}{s}"))
@@ -963,7 +963,7 @@ fn hide_sharp_behind_comment(s: &str) -> Cow<'_, str> {
963963
}
964964
}
965965

966-
fn trim_custom_comment_prefix(s: &str) -> String {
966+
pub(crate) fn trim_custom_comment_prefix(s: &str) -> String {
967967
s.lines()
968968
.map(|line| {
969969
let left_trimmed = line.trim_start();

0 commit comments

Comments
 (0)