Skip to content

Commit 4cd5840

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 164648 b: refs/heads/auto c: 2df30a4 h: refs/heads/master v: v3
1 parent 0a9488f commit 4cd5840

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
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 1d25271e054fdefe5e940ab4cc5e098f47c46966
13+
refs/heads/auto: 2df30a47e2e0ef563d9ed80cb3cc258cbea0f53a
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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/auto/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)