archive
/
md-pdf-rs
Archived
1
Fork 0

Reduce compiler warnings

This commit is contained in:
Jake Howard 2017-11-21 22:17:35 +00:00
parent 51d82ff192
commit 9f15c57970
Signed by: jake
GPG Key ID: 57AFB45680EDD477
8 changed files with 6 additions and 17 deletions

View File

@ -28,11 +28,6 @@ fn get_csl_data(csl_name: String) -> Result<String, String> {
return Ok(csl_buffer);
}
pub fn is_valid_csl(csl_name: String) -> bool {
return get_csl_data(csl_name).is_ok();
}
pub fn unpack_csl(csl_name: String) -> PathBuf {
let file = get_temp_file();
let mut csl_temp = File::create(&file).expect("Failed to open temporary file");

View File

@ -1,9 +1,8 @@
use serde_yaml;
use serde_yaml::Value;
use std::path::PathBuf;
use std::collections::HashMap;
use utils::{result_prefix, resolve_path, result_override};
use std::fs::{remove_file, File};
use std::fs::File;
use std::env::current_dir;
use std::io::Read;

View File

@ -34,11 +34,6 @@ pub fn find_first(root: &mut Element, selector: &str) -> Element {
return all_matches.pop().expect(&format!("Failed to find {}.", selector));
}
pub fn destroy_at(root: &mut Element, index: usize) {
let mut ele = root.get(index).expect(&format!("Failed to get element at {}.", index));
ele.destroy().expect("Failed to delete.");
}
pub fn destroy_matching(root: &mut Element, selector: &str) {
let matches = find_all(root, selector);
if matches.is_empty() {

View File

@ -3,7 +3,7 @@ use sciter::Element;
use config::Config;
pub fn head_cleanup(config: Config, input: String) -> Result<String, String> {
pub fn head_cleanup(_: Config, input: String) -> Result<String, String> {
let mut root = sciter_start(input);
let mut head = get_head(&mut root);
destroy_matching(&mut head, "meta[content='text/css']");

View File

@ -3,7 +3,7 @@ use config::Config;
use utils::{resolve_path, path_to_string};
pub fn images(config: Config, input: String) -> Result<String, String> {
pub fn images(_: Config, input: String) -> Result<String, String> {
let mut root = sciter_start(input);
let mut body = get_body(&mut root);
let images = find_all(&mut body, "img[src]");

View File

@ -2,7 +2,7 @@ use html::{sciter_start, get_html, get_head, find_first};
use config::Config;
pub fn rebrand(config: Config, input: String) -> Result<String, String> {
pub fn rebrand(_: Config, input: String) -> Result<String, String> {
let mut root = sciter_start(input);
let mut head = get_head(&mut root);
let mut ele = find_first(&mut head, "meta[name='generator']");

View File

@ -10,7 +10,7 @@ fn create_title() -> Element {
}
pub fn references(config: Config, input: String) -> Result<String, String> {
pub fn references(_: Config, input: String) -> Result<String, String> {
let mut root = sciter_start(input);
let mut body = get_body(&mut root);
let possible_references = body.find_first("div#refs").expect("Failed to get refs");

View File

@ -12,7 +12,7 @@ fn remove_blank_lines(line: &&str) -> bool {
return true;
}
pub fn strip_blank(config: Config, input: String) -> Result<String, String> {
pub fn strip_blank(_w: Config, input: String) -> Result<String, String> {
let split: Vec<&str> = input.lines().filter(remove_blank_lines).collect();
return Ok(split.join("\n"));
}