alexcrichton / xz2-rs

Bindings to liblzma in Rust (xz streams in Rust)
Apache License 2.0
81 stars 52 forks source link

Adding new enum Level #126

Open garbage-repo opened 3 months ago

garbage-repo commented 3 months ago

Hi,

May I ask if you would agree to a PR adding new enum Level, like sample below:

#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
pub enum Level {
    L0,
    L1,
    L2,
    L3,
    L4,
    L5,
    L6,
    L7,
    L8,
    L9,
}

impl Level {

    pub (crate) const fn raw(&self) -> u32 {
        *self as u32
    }

}

Currently XzEncoder::new() just takes a u32 value. I made Level and used it personally. I would like to add it to your crate.

Please let me know what you think.

Thank you,