From 4abac12c0451db9b0c2e6be26ac5d976797ddd43 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sat, 23 Mar 2019 08:47:10 -0400 Subject: [PATCH] Fix deprecation warnings for trim left/right matches --- src/utils/mod.rs | 2 +- tests/rendered_output.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/mod.rs b/src/utils/mod.rs index df997d5e..76dd16b9 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -61,7 +61,7 @@ pub fn id_from_content(content: &str) -> String { } // Remove spaces and hashes indicating a header - let trimmed = content.trim().trim_left_matches('#').trim(); + let trimmed = content.trim().trim_start_matches('#').trim(); normalize_id(trimmed) } diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index b7777ee7..062674a3 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -423,8 +423,8 @@ mod search { fn read_book_index(root: &Path) -> serde_json::Value { let index = root.join("book/searchindex.js"); let index = file_to_string(index).unwrap(); - let index = index.trim_left_matches("window.search = "); - let index = index.trim_right_matches(";"); + let index = index.trim_start_matches("window.search = "); + let index = index.trim_end_matches(";"); serde_json::from_str(&index).unwrap() }