Created first disk
This commit is contained in:
virtweb_backend/src
virtweb_frontend/src
@ -1,4 +1,4 @@
|
||||
use std::path::PathBuf;
|
||||
use std::path::Path;
|
||||
|
||||
const INVALID_CHARS: [&str; 19] = [
|
||||
"@", "\\", "/", ":", ",", "<", ">", "%", "'", "\"", "?", "{", "}", "$", "*", "|", ";", "=",
|
||||
@ -11,7 +11,8 @@ pub fn check_file_name(name: &str) -> bool {
|
||||
}
|
||||
|
||||
/// Create directory if missing
|
||||
pub fn create_directory_if_missing(path: &PathBuf) -> anyhow::Result<()> {
|
||||
pub fn create_directory_if_missing<P: AsRef<Path>>(path: P) -> anyhow::Result<()> {
|
||||
let path = path.as_ref();
|
||||
if !path.exists() {
|
||||
std::fs::create_dir_all(path)?;
|
||||
}
|
||||
|
Reference in New Issue
Block a user