Cargo clippy

This commit is contained in:
ChristianVisintin
2021-01-16 18:02:12 +01:00
parent ac02928e69
commit 23ca2baa8c
8 changed files with 29 additions and 38 deletions

View File

@@ -369,6 +369,7 @@ impl BookmarksClient {
}
#[cfg(test)]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
mod tests {
use super::*;
@@ -376,7 +377,7 @@ mod tests {
use std::time::Duration;
#[test]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_new() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -409,7 +410,7 @@ mod tests {
}
#[test]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_new_from_existing() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -455,7 +456,7 @@ mod tests {
}
#[test]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_manipulate_bookmarks() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -501,7 +502,7 @@ mod tests {
#[test]
#[should_panic]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_bad_bookmark_name() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -520,7 +521,7 @@ mod tests {
}
#[test]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_manipulate_recents() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -555,7 +556,7 @@ mod tests {
}
#[test]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_dup_recent() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -580,7 +581,7 @@ mod tests {
}
#[test]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_recents_more_than_limit() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -628,7 +629,7 @@ mod tests {
#[test]
#[should_panic]
#[cfg(not(target_os = "macos"))] // CI/CD blocks
fn test_system_bookmarks_add_bookmark_empty() {
let tmp_dir: tempfile::TempDir = create_tmp_dir();
let (cfg_path, key_path): (PathBuf, PathBuf) = get_paths(tmp_dir.path());
@@ -649,6 +650,7 @@ mod tests {
/// ### get_paths
///
/// Get paths for configuration and key for bookmarks
fn get_paths(dir: &Path) -> (PathBuf, PathBuf) {
let k: PathBuf = PathBuf::from(dir);
let mut c: PathBuf = k.clone();
@@ -659,6 +661,7 @@ mod tests {
/// ### create_tmp_dir
///
/// Create temporary directory
fn create_tmp_dir() -> tempfile::TempDir {
tempfile::TempDir::new().ok().unwrap()
}