blivet 0.5.0

A correct, full-featured Unix daemon library and CLI for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Shared utility functions used across multiple modules.

use std::path::Path;

/// Compare two paths using canonicalize() with byte-equal fallback.
pub(crate) fn paths_same(a: &Path, b: &Path) -> bool {
    match (std::fs::canonicalize(a), std::fs::canonicalize(b)) {
        (Ok(ca), Ok(cb)) => ca == cb,
        _ => a == b,
    }
}