libterm: use #[deriving(Copy)]

This commit is contained in:
Jorge Aparicio 2014-12-14 23:33:35 -05:00
parent 86f8c127dd
commit 64234b3541
2 changed files with 5 additions and 14 deletions

View File

@ -165,13 +165,13 @@ pub mod color {
/// Terminal attributes
pub mod attr {
pub use self::Attr::*;
use std::kinds::Copy;
/// Terminal attributes for use with term.attr().
///
/// Most attributes can only be turned on and must be turned off with term.reset().
/// The ones that can be turned off explicitly take a boolean value.
/// Color is also represented as an attribute for convenience.
#[deriving(Copy)]
pub enum Attr {
/// Bold (or possibly bright) mode
Bold,
@ -194,8 +194,6 @@ pub mod attr {
/// Convenience attribute to set the background color
BackgroundColor(super::color::Color)
}
impl Copy for Attr {}
}
/// A terminal with similar capabilities to an ANSI Terminal

View File

@ -16,7 +16,7 @@ use self::FormatState::*;
use self::FormatOp::*;
use std::mem::replace;
#[deriving(PartialEq)]
#[deriving(Copy, PartialEq)]
enum States {
Nothing,
Percent,
@ -33,17 +33,13 @@ enum States {
SeekIfEndPercent(int)
}
impl Copy for States {}
#[deriving(PartialEq)]
#[deriving(Copy, PartialEq)]
enum FormatState {
FormatStateFlags,
FormatStateWidth,
FormatStatePrecision
}
impl Copy for FormatState {}
/// Types of parameters a capability can use
#[allow(missing_docs)]
#[deriving(Clone)]
@ -446,7 +442,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
Ok(output)
}
#[deriving(PartialEq)]
#[deriving(Copy, PartialEq)]
struct Flags {
width: uint,
precision: uint,
@ -456,8 +452,6 @@ struct Flags {
space: bool
}
impl Copy for Flags {}
impl Flags {
fn new() -> Flags {
Flags{ width: 0, precision: 0, alternate: false,
@ -465,6 +459,7 @@ impl Flags {
}
}
#[deriving(Copy)]
enum FormatOp {
FormatDigit,
FormatOctal,
@ -473,8 +468,6 @@ enum FormatOp {
FormatString
}
impl Copy for FormatOp {}
impl FormatOp {
fn from_char(c: char) -> FormatOp {
match c {