Merge pull request #892 from integer32llc/fix-warnings

Fix deprecation warnings for trim left/right matches
This commit is contained in:
Dylan DPC 2019-04-21 21:20:39 +02:00 committed by GitHub
commit cb94053779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ pub fn id_from_content(content: &str) -> String {
} }
// Remove spaces and hashes indicating a header // 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) normalize_id(trimmed)
} }

View File

@ -423,8 +423,8 @@ mod search {
fn read_book_index(root: &Path) -> serde_json::Value { fn read_book_index(root: &Path) -> serde_json::Value {
let index = root.join("book/searchindex.js"); let index = root.join("book/searchindex.js");
let index = file_to_string(index).unwrap(); let index = file_to_string(index).unwrap();
let index = index.trim_left_matches("window.search = "); let index = index.trim_start_matches("window.search = ");
let index = index.trim_right_matches(";"); let index = index.trim_end_matches(";");
serde_json::from_str(&index).unwrap() serde_json::from_str(&index).unwrap()
} }