Skip to content

Commit

Permalink
Fix a few linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ortham committed Aug 27, 2017
1 parent c54840f commit 2a7ebf8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/game_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ fn use_my_games_directory(ini_path: &Path) -> bool {
mod tests {
extern crate tempdir;

#[cfg(windows)]
use std::env;
use std::io::Write;
use self::tempdir::TempDir;
Expand Down
2 changes: 1 addition & 1 deletion src/ghostable_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,6 @@ mod tests {

#[test]
fn resolve_path_should_error_if_no_path_exists() {
let mut path = Path::new("foo").resolve_path().is_err();
assert!(Path::new("foo").resolve_path().is_err());
}
}
2 changes: 1 addition & 1 deletion src/load_order/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl From<Cow<'static, str>> for LoadOrderError {
}

impl From<regex::Error> for LoadOrderError {
fn from(error: regex::Error) -> Self {
fn from(_: regex::Error) -> Self {
LoadOrderError::InvalidRegex
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/load_order/methods/textfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ use encoding::{DecoderTrap, Encoding, EncoderTrap};
use encoding::all::WINDOWS_1252;
use unicase::eq;

use game_settings::GameSettings;
use plugin::Plugin;
use load_order::{create_parent_dirs, find_first_non_master_position, read_plugin_names};
use load_order::error::LoadOrderError;
use load_order::mutable::MutableLoadOrder;
use load_order::readable::ReadableLoadOrder;
use load_order::writable::WritableLoadOrder;

pub fn insert_position<T: ReadableLoadOrder>(load_order: &T, plugin: &Plugin) -> Option<usize> {
let is_game_master = plugin
Expand Down
1 change: 0 additions & 1 deletion src/load_order/methods/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use load_order::{create_parent_dirs, find_first_non_master_position};
use load_order::error::LoadOrderError;
use load_order::mutable::MutableLoadOrder;
use load_order::readable::ReadableLoadOrder;
use load_order::writable::WritableLoadOrder;

pub fn insert_position<T: ReadableLoadOrder>(load_order: &T, plugin: &Plugin) -> Option<usize> {
if plugin.is_master_file() {
Expand Down
10 changes: 3 additions & 7 deletions src/load_order/writable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ mod tests {
}

impl MutableLoadOrder for TestLoadOrder {
fn insert_position(&self, plugin: &Plugin) -> Option<usize> {
fn insert_position(&self, _: &Plugin) -> Option<usize> {
None
}

Expand All @@ -167,16 +167,12 @@ mod tests {
}

// Dummy method, unused.
fn set_load_order(&mut self, plugin_names: &[&str]) -> Result<(), LoadOrderError> {
fn set_load_order(&mut self, _: &[&str]) -> Result<(), LoadOrderError> {
Ok(())
}

// Dummy method, unused.
fn set_plugin_index(
&mut self,
plugin_name: &str,
position: usize,
) -> Result<(), LoadOrderError> {
fn set_plugin_index(&mut self, _: &str, _: usize) -> Result<(), LoadOrderError> {
Ok(())
}
}
Expand Down

0 comments on commit 2a7ebf8

Please sign in to comment.