make logic and comments more like C (early returns instead of nestedness)

next commit: cargo fmt
This commit is contained in:
holger krekel
2019-09-20 17:53:07 +02:00
parent 0bdcc4269f
commit 497ffd86fa
2 changed files with 47 additions and 62 deletions

View File

@@ -843,8 +843,9 @@ pub fn dc_get_fine_path_filename(
let now = time();
let folder = PathBuf::from(folder.as_ref());
// XXX sanitize desired_filename eg using
// https://github.com/kardeiz/sanitize-filename/blob/master/src/lib.rs
let suffix = validate_filename(desired_filename_suffix.as_ref());
let file_name = PathBuf::from(suffix);
let extension = file_name.extension().map(|c| c.clone());