Skip to content

Commit 760af6c

Browse files
committed
Make format_snippet and format_code_block private
cc #2639
1 parent 9226a50 commit 760af6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ enum ParseError<'sess> {
656656

657657
/// Format the given snippet. The snippet is expected to be *complete* code.
658658
/// When we cannot parse the given snippet, this function returns `None`.
659-
pub fn format_snippet(snippet: &str, config: &Config) -> Option<String> {
659+
fn format_snippet(snippet: &str, config: &Config) -> Option<String> {
660660
let mut out: Vec<u8> = Vec::with_capacity(snippet.len() * 2);
661661
let input = Input::Text(snippet.into());
662662
let mut config = config.clone();
@@ -694,7 +694,7 @@ fn enclose_in_main_block(s: &str, config: &Config) -> String {
694694
/// The code block may be incomplete (i.e. parser may be unable to parse it).
695695
/// To avoid panic in parser, we wrap the code block with a dummy function.
696696
/// The returned code block does *not* end with newline.
697-
pub fn format_code_block(code_snippet: &str, config: &Config) -> Option<String> {
697+
fn format_code_block(code_snippet: &str, config: &Config) -> Option<String> {
698698
// Wrap the given code block with `fn main()` if it does not have one.
699699
let snippet = enclose_in_main_block(code_snippet, config);
700700
let mut result = String::with_capacity(snippet.len());

0 commit comments

Comments
 (0)