Make many structs cloneable.

This commit is contained in:
Gavin Panella 2019-05-08 23:19:21 +02:00 committed by Pierre Peltier
parent 3d8e9c1b78
commit 303e254611
7 changed files with 8 additions and 8 deletions

View file

@ -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 {

View file

@ -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 {

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,