~nickbp/originz

ref: d94f181c5fbfdf0f62b40ea46d3f301f4ec681e5 originz/src/filter/path.rs -rw-r--r-- 428 bytes
d94f181cNick Parker Backport current benchmark to older code 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![deny(warnings)]

use std::ffi::OsString;
use std::path::Path;

/// File extension used on zstd-compressed files.
/// This is in addition to any existing extension, e.g. "mycrimes.txt.zst"
pub const ZSTD_EXTENSION: &'static str = "zst";

pub fn is_zstd_extension(path: &Path) -> bool {
    return match path.extension() {
        Some(ext) => ext == OsString::from(ZSTD_EXTENSION).as_os_str(),
        None => false,
    };
}