Skip to content

Commit 64234b3

Browse files
author
Jorge Aparicio
committed
libterm: use #[deriving(Copy)]
1 parent 86f8c12 commit 64234b3

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/libterm/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ pub mod color {
165165
/// Terminal attributes
166166
pub mod attr {
167167
pub use self::Attr::*;
168-
use std::kinds::Copy;
169168

170169
/// Terminal attributes for use with term.attr().
171170
///
172171
/// Most attributes can only be turned on and must be turned off with term.reset().
173172
/// The ones that can be turned off explicitly take a boolean value.
174173
/// Color is also represented as an attribute for convenience.
174+
#[deriving(Copy)]
175175
pub enum Attr {
176176
/// Bold (or possibly bright) mode
177177
Bold,
@@ -194,8 +194,6 @@ pub mod attr {
194194
/// Convenience attribute to set the background color
195195
BackgroundColor(super::color::Color)
196196
}
197-
198-
impl Copy for Attr {}
199197
}
200198

201199
/// A terminal with similar capabilities to an ANSI Terminal

src/libterm/terminfo/parm.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use self::FormatState::*;
1616
use self::FormatOp::*;
1717
use std::mem::replace;
1818

19-
#[deriving(PartialEq)]
19+
#[deriving(Copy, PartialEq)]
2020
enum States {
2121
Nothing,
2222
Percent,
@@ -33,17 +33,13 @@ enum States {
3333
SeekIfEndPercent(int)
3434
}
3535

36-
impl Copy for States {}
37-
38-
#[deriving(PartialEq)]
36+
#[deriving(Copy, PartialEq)]
3937
enum FormatState {
4038
FormatStateFlags,
4139
FormatStateWidth,
4240
FormatStatePrecision
4341
}
4442

45-
impl Copy for FormatState {}
46-
4743
/// Types of parameters a capability can use
4844
#[allow(missing_docs)]
4945
#[deriving(Clone)]
@@ -446,7 +442,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
446442
Ok(output)
447443
}
448444

449-
#[deriving(PartialEq)]
445+
#[deriving(Copy, PartialEq)]
450446
struct Flags {
451447
width: uint,
452448
precision: uint,
@@ -456,15 +452,14 @@ struct Flags {
456452
space: bool
457453
}
458454

459-
impl Copy for Flags {}
460-
461455
impl Flags {
462456
fn new() -> Flags {
463457
Flags{ width: 0, precision: 0, alternate: false,
464458
left: false, sign: false, space: false }
465459
}
466460
}
467461

462+
#[deriving(Copy)]
468463
enum FormatOp {
469464
FormatDigit,
470465
FormatOctal,
@@ -473,8 +468,6 @@ enum FormatOp {
473468
FormatString
474469
}
475470

476-
impl Copy for FormatOp {}
477-
478471
impl FormatOp {
479472
fn from_char(c: char) -> FormatOp {
480473
match c {

0 commit comments

Comments
 (0)