1- use crate :: static_regex;
1+ use mdbook_core :: static_regex;
22use std:: ops:: Bound :: { Excluded , Included , Unbounded } ;
33use std:: ops:: RangeBounds ;
44
55/// Take a range of lines from a string.
6- pub fn take_lines < R : RangeBounds < usize > > ( s : & str , range : R ) -> String {
6+ pub ( super ) fn take_lines < R : RangeBounds < usize > > ( s : & str , range : R ) -> String {
77 let start = match range. start_bound ( ) {
88 Excluded ( & n) => n + 1 ,
99 Included ( & n) => n,
@@ -28,7 +28,7 @@ static_regex!(ANCHOR_END, r"ANCHOR_END:\s*(?P<anchor_name>[\w_-]+)");
2828
2929/// Take anchored lines from a string.
3030/// Lines containing anchor are ignored.
31- pub fn take_anchored_lines ( s : & str , anchor : & str ) -> String {
31+ pub ( super ) fn take_anchored_lines ( s : & str , anchor : & str ) -> String {
3232 let mut retained = Vec :: < & str > :: new ( ) ;
3333 let mut anchor_found = false ;
3434
@@ -60,7 +60,7 @@ pub fn take_anchored_lines(s: &str, anchor: &str) -> String {
6060/// For any lines not in the range, include them but use `#` at the beginning. This will hide the
6161/// lines from initial display but include them when expanding the code snippet or testing with
6262/// rustdoc.
63- pub fn take_rustdoc_include_lines < R : RangeBounds < usize > > ( s : & str , range : R ) -> String {
63+ pub ( super ) fn take_rustdoc_include_lines < R : RangeBounds < usize > > ( s : & str , range : R ) -> String {
6464 let mut output = String :: with_capacity ( s. len ( ) ) ;
6565
6666 for ( index, line) in s. lines ( ) . enumerate ( ) {
@@ -78,7 +78,7 @@ pub fn take_rustdoc_include_lines<R: RangeBounds<usize>>(s: &str, range: R) -> S
7878/// For any lines not between the anchors, include them but use `#` at the beginning. This will
7979/// hide the lines from initial display but include them when expanding the code snippet or testing
8080/// with rustdoc.
81- pub fn take_rustdoc_include_anchored_lines ( s : & str , anchor : & str ) -> String {
81+ pub ( super ) fn take_rustdoc_include_anchored_lines ( s : & str , anchor : & str ) -> String {
8282 let mut output = String :: with_capacity ( s. len ( ) ) ;
8383 let mut within_anchored_section = false ;
8484
0 commit comments