Function uucore::backup_control::source_is_target_backup
source · pub fn source_is_target_backup(
source: &Path,
target: &Path,
suffix: &str
) -> boolExpand description
Returns true if the source file is likely to be the simple backup file for the target file.
Arguments
source- A Path reference that holds the source (backup) file path.target- A Path reference that holds the target file path.suffix- Str that holds the backup suffix.
Examples
use std::path::Path;
use uucore::backup_control::source_is_target_backup;
let source = Path::new("data.txt~");
let target = Path::new("data.txt");
let suffix = String::from("~");
assert_eq!(source_is_target_backup(&source, &target, &suffix), true);