Skip to content

Commit bba1216

Browse files
committed
Move id_from_content private
This follows through with the deprecation of `id_from_content` which was deprecated in #1749.
1 parent 7e09491 commit bba1216

File tree

1 file changed

+2
-7
lines changed
  • crates/mdbook-core/src/utils

1 file changed

+2
-7
lines changed

crates/mdbook-core/src/utils/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ pub fn normalize_id(content: &str) -> String {
4343

4444
/// Generate an ID for use with anchors which is derived from a "normalised"
4545
/// string.
46-
// This function should be made private when the deprecation expires.
47-
#[deprecated(since = "0.4.16", note = "use unique_id_from_content instead")]
48-
pub fn id_from_content(content: &str) -> String {
46+
fn id_from_content(content: &str) -> String {
4947
let mut content = content.to_string();
5048

5149
// Skip any tags or html-encoded stuff
@@ -67,10 +65,7 @@ pub fn id_from_content(content: &str) -> String {
6765
/// Each ID returned will be unique, if the same `id_counter` is provided on
6866
/// each call.
6967
pub fn unique_id_from_content(content: &str, id_counter: &mut HashMap<String, usize>) -> String {
70-
let id = {
71-
#[allow(deprecated)]
72-
id_from_content(content)
73-
};
68+
let id = id_from_content(content);
7469

7570
// If we have headers with the same normalized id, append an incrementing counter
7671
let id_count = id_counter.entry(id.clone()).or_insert(0);

0 commit comments

Comments
 (0)