src/tools/process_locker.rs: new() - use generic path parameter

This commit is contained in:
Dietmar Maurer 2019-03-22 09:41:32 +01:00
parent a650f50301
commit abfc001f25

View File

@ -85,7 +85,7 @@ impl ProcessLocker {
/// Create a new instance for the specified file.
///
/// This simply creates the file if it does not exist.
pub fn new(lockfile: &str) -> Result<Arc<Mutex<Self>>, Error> {
pub fn new<P: AsRef<std::path::Path>>(lockfile: P) -> Result<Arc<Mutex<Self>>, Error> {
let file = std::fs::OpenOptions::new()
.create(true)