mirror of
https://github.com/XAMPPRocky/tokei
synced 2024-09-14 05:21:21 +00:00
29 lines
599 B
Rust
29 lines
599 B
Rust
use std::borrow::Cow;
|
|
|
|
/// Used for sorting languages.
|
|
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
|
pub enum Sort {
|
|
/// Sort by number blank lines.
|
|
Blanks,
|
|
/// Sort by number comments lines.
|
|
Comments,
|
|
/// Sort by number code lines.
|
|
Code,
|
|
/// Sort by number files lines.
|
|
Files,
|
|
/// Sort by number of lines.
|
|
Lines,
|
|
}
|
|
|
|
impl<'a> From<Sort> for Cow<'a, Sort> {
|
|
fn from(from: Sort) -> Self {
|
|
Cow::Owned(from)
|
|
}
|
|
}
|
|
|
|
impl<'a> From<&'a Sort> for Cow<'a, Sort> {
|
|
fn from(from: &'a Sort) -> Self {
|
|
Cow::Borrowed(from)
|
|
}
|
|
}
|