Skip to main content

resolve_commit_with

Function resolve_commit_with 

Source
pub fn resolve_commit_with<F, S>(
    store: &PdfSaveTokenStore,
    token: &str,
    target_path: Option<String>,
    same_file: S,
    read_current_source_for_recheck: F,
) -> Result<(String, Vec<u8>, PdfCommitResult), PdfEditError>
where F: FnOnce(&str) -> Result<Vec<u8>, PdfEditError>, S: FnOnce(&str, &str) -> bool,
Expand description

resolve_commit with the “is the target the source file?” decision supplied by the caller: same_file(source_path, target_path) is called once, after the token is consumed, and the source recheck runs exactly when it returns true. Passing a comparison of filesystem identities (device and file id, canonical path as the fallback) closes the alias bypass that plain string equality leaves open.