src/tools/file_logger.rs: new - accept AsRef<Path>

This commit is contained in:
Dietmar Maurer 2019-04-03 14:13:33 +02:00
parent 3c2012f97a
commit d3d7ab1273

View File

@ -34,7 +34,7 @@ macro_rules! flog {
impl FileLogger {
pub fn new(file_name: &str, to_stdout: bool) -> Result<Self, Error> {
pub fn new<P: AsRef<std::path::Path>>(file_name: P, to_stdout: bool) -> Result<Self, Error> {
let file = std::fs::OpenOptions::new()
.read(true)