refactor(config): put test-only modules in own mod

std::fs and std::io::Write are used in the unit tests,
but not in the main program itself, which results in a
warning by the Rust compiler. They are now only used
in the test module, when `cargo test` is run.
main
Angelo Fallaria 2 years ago
parent e10d2ac005
commit 7098ff3aab

@ -1,8 +1,7 @@
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;
use std::io::Write;
use std::{fs, path};
use std::path;
#[derive(Debug)]
pub enum Error {
@ -303,6 +302,8 @@ fn parse_contents(contents: String) -> Result<Vec<Hotkey>, Error> {
#[cfg(test)]
mod tests {
use super::*;
use std::fs;
use std::io::Write;
// Implement a struct for a path used in tests
// so that the test file will be automatically removed

Loading…
Cancel
Save