Only add / if the strings aren't empty.

This commit is contained in:
Edu4rdSHL 2021-04-17 02:02:26 -05:00
parent a7536ef65a
commit 48fb307c57
No known key found for this signature in database
GPG key ID: 3A574A4009F553E5

View file

@ -3,10 +3,10 @@ use rusnapshot::{args, controller, database, errors::*};
fn run() -> Result<()> {
let mut arguments = args::get_args();
if !arguments.source_dir.ends_with('/') {
if !arguments.source_dir.is_empty() && !arguments.source_dir.ends_with('/') {
arguments.source_dir += "/"
}
if !arguments.dest_dir.ends_with('/') {
if !arguments.dest_dir.is_empty() && !arguments.dest_dir.ends_with('/') {
arguments.dest_dir += "/"
}