Skip to content

Commit b61cd51

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 165880 b: refs/heads/try c: 2df30a4 h: refs/heads/master v: v3
1 parent 40da85e commit b61cd51

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 18842f89f084c52588fe7cffe07f87bf6e90796a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 658529467d9d69ac9e09cacf98a6d61d781c2c76
5-
refs/heads/try: 1d25271e054fdefe5e940ab4cc5e098f47c46966
5+
refs/heads/try: 2df30a47e2e0ef563d9ed80cb3cc258cbea0f53a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libserialize/base64.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,25 @@ use std::fmt;
1919
use std::error;
2020

2121
/// Available encoding character sets
22+
#[deriving(Copy)]
2223
pub enum CharacterSet {
2324
/// The standard character set (uses `+` and `/`)
2425
Standard,
2526
/// The URL safe character set (uses `-` and `_`)
2627
UrlSafe
2728
}
2829

29-
impl Copy for CharacterSet {}
30-
3130
/// Available newline types
31+
#[deriving(Copy)]
3232
pub enum Newline {
3333
/// A linefeed (i.e. Unix-style newline)
3434
LF,
3535
/// A carriage return and a linefeed (i.e. Windows-style newline)
3636
CRLF
3737
}
3838

39-
impl Copy for Newline {}
40-
4139
/// Contains configuration parameters for `to_base64`.
40+
#[deriving(Copy)]
4241
pub struct Config {
4342
/// Character set to use
4443
pub char_set: CharacterSet,
@@ -50,8 +49,6 @@ pub struct Config {
5049
pub line_length: Option<uint>
5150
}
5251

53-
impl Copy for Config {}
54-
5552
/// Configuration for RFC 4648 standard base64 encoding
5653
pub static STANDARD: Config =
5754
Config {char_set: Standard, newline: Newline::CRLF, pad: true, line_length: None};
@@ -180,15 +177,14 @@ pub trait FromBase64 for Sized? {
180177
}
181178

182179
/// Errors that can occur when decoding a base64 encoded string
180+
#[deriving(Copy)]
183181
pub enum FromBase64Error {
184182
/// The input contained a character not part of the base64 format
185183
InvalidBase64Byte(u8, uint),
186184
/// The input had an invalid length
187185
InvalidBase64Length,
188186
}
189187

190-
impl Copy for FromBase64Error {}
191-
192188
impl fmt::Show for FromBase64Error {
193189
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
194190
match *self {

branches/try/src/libserialize/hex.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,14 @@ pub trait FromHex for Sized? {
6161
}
6262

6363
/// Errors that can occur when decoding a hex encoded string
64+
#[deriving(Copy)]
6465
pub enum FromHexError {
6566
/// The input contained a character not part of the hex format
6667
InvalidHexCharacter(char, uint),
6768
/// The input had an invalid length
6869
InvalidHexLength,
6970
}
7071

71-
impl Copy for FromHexError {}
72-
7372
impl fmt::Show for FromHexError {
7473
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7574
match *self {

branches/try/src/libserialize/json.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ pub type Array = Vec<Json>;
226226
pub type Object = BTreeMap<string::String, Json>;
227227

228228
/// The errors that can arise while parsing a JSON stream.
229-
#[deriving(Clone, PartialEq)]
229+
#[deriving(Clone, Copy, PartialEq)]
230230
pub enum ErrorCode {
231231
InvalidSyntax,
232232
InvalidNumber,
@@ -247,17 +247,13 @@ pub enum ErrorCode {
247247
NotUtf8,
248248
}
249249

250-
impl Copy for ErrorCode {}
251-
252-
#[deriving(Clone, PartialEq, Show)]
250+
#[deriving(Clone, Copy, PartialEq, Show)]
253251
pub enum ParserError {
254252
/// msg, line, col
255253
SyntaxError(ErrorCode, uint, uint),
256254
IoError(io::IoErrorKind, &'static str),
257255
}
258256

259-
impl Copy for ParserError {}
260-
261257
// Builder and Parser have the same errors.
262258
pub type BuilderError = ParserError;
263259

0 commit comments

Comments
 (0)