提交 64234b35 编写于 作者: J Jorge Aparicio

libterm: use `#[deriving(Copy)]`

上级 86f8c127
......@@ -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 enum 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
......
......@@ -16,7 +16,7 @@
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 @@ fn new() -> 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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册