~nickbp/originz

ref: fbaed2a25114cf06aaa5d509c0d19d28ac4faa6d originz/src/filter/path.rs -rw-r--r-- 446 bytes
fbaed2a2Nick Parker Implement benchmark test for UDP client/UDP upstream (#10) 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![deny(warnings, rust_2018_idioms)]

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,
    };
}