]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/tools/file_logger.rs: new - accept AsRef<Path>
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 3 Apr 2019 12:13:33 +0000 (14:13 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 3 Apr 2019 12:13:33 +0000 (14:13 +0200)
src/tools/file_logger.rs

index 423e998c087910f9d521295a0dd7f3690e15e238..0475073bc1cfc60db059494f86d99f1540515ccc 100644 (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)