mirror of
https://github.com/lsd-rs/lsd
synced 2025-03-04 23:17:15 +00:00
Make many structs cloneable.
This commit is contained in:
parent
3d8e9c1b78
commit
303e254611
7 changed files with 8 additions and 8 deletions
|
@ -5,7 +5,7 @@ use std::fs::Metadata;
|
|||
use std::time::UNIX_EPOCH;
|
||||
use time::{Duration, Timespec};
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct Date(time::Tm);
|
||||
|
||||
impl<'a> From<&'a Metadata> for Date {
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::flags::Flags;
|
|||
use crate::meta::FileType;
|
||||
use ansi_term::ANSIString;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Indicator(&'static str);
|
||||
|
||||
impl From<FileType> for Indicator {
|
||||
|
|
|
@ -25,7 +25,7 @@ use std::fs::read_link;
|
|||
use std::io::{Error, ErrorKind};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Meta {
|
||||
pub name: Name,
|
||||
pub path: PathBuf,
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::meta::filetype::FileType;
|
|||
use std::cmp::{Ordering, PartialOrd};
|
||||
use std::path::Path;
|
||||
|
||||
#[derive(Debug, Eq)]
|
||||
#[derive(Clone, Debug, Eq)]
|
||||
pub struct Name {
|
||||
pub name: String,
|
||||
path: String,
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::color::{ColoredString, Colors, Elem};
|
|||
#[cfg(unix)]
|
||||
use std::fs::Metadata;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Owner {
|
||||
user: String,
|
||||
group: String,
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::color::{ColoredString, Colors, Elem};
|
|||
use crate::flags::{Flags, SizeFlag};
|
||||
use std::fs::Metadata;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum Unit {
|
||||
None,
|
||||
Byte,
|
||||
|
@ -12,7 +12,7 @@ pub enum Unit {
|
|||
Tera,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Size {
|
||||
value: u64,
|
||||
unit: Unit,
|
||||
|
|
|
@ -3,7 +3,7 @@ use ansi_term::{ANSIString, ANSIStrings};
|
|||
use std::fs::read_link;
|
||||
use std::path::Path;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct SymLink {
|
||||
target: Option<String>,
|
||||
valid: bool,
|
||||
|
|
Loading…
Add table
Reference in a new issue