Skip to content

Commit b51dc6a

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163675 b: refs/heads/snap-stage3 c: 2df30a4 h: refs/heads/master i: 163673: 6db7606 163671: 0ed7054 v: v3
1 parent aaf7e12 commit b51dc6a

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1d25271e054fdefe5e940ab4cc5e098f47c46966
4+
refs/heads/snap-stage3: 2df30a47e2e0ef563d9ed80cb3cc258cbea0f53a
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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)