Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 47533b5

Browse files
committed
Merge pull request #187 from Ryman/copy
Copy is now opt-in
2 parents ac5f023 + d2ee440 commit 47533b5

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

codegen/status.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ use super::get_writer;
1414

1515
use self::HeadingOrStatus::{Heading, Status};
1616

17+
#[deriving(Copy)]
1718
enum HeadingOrStatus {
1819
Heading(&'static str),
1920
Status(HttpStatus),
2021
}
2122

23+
#[deriving(Copy)]
2224
struct HttpStatus {
2325
code: uint,
2426
reason: &'static str,

src/http/headers/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ use self::HeaderLineErr::{EndOfFile, EndOfHeaders, MalformedHeaderValue,
1717
MalformedHeaderSyntax};
1818
use self::HeaderValueByteIteratorState::{Normal, GotLF, Finished};
1919

20-
pub enum HeaderLineErr { EndOfFile, EndOfHeaders, MalformedHeaderValue, MalformedHeaderSyntax }
20+
#[deriving(Copy)]
21+
pub enum HeaderLineErr {
22+
EndOfFile,
23+
EndOfHeaders,
24+
MalformedHeaderValue,
25+
MalformedHeaderSyntax
26+
}
2127

2228
pub mod test_utils;
2329
pub mod serialization_utils;
@@ -66,7 +72,7 @@ pub mod transfer_encoding;
6672

6773
pub type DeltaSeconds = u64;
6874

69-
#[deriving(Clone, PartialEq, Eq)]
75+
#[deriving(Clone, PartialEq, Eq, Copy)]
7076
pub enum ConsumeCommaLWSResult {
7177
CommaConsumed,
7278
EndOfValue,
@@ -1128,6 +1134,6 @@ headers_mod! {
11281134
26, "Content-Type", "content-type", ContentType, content_type, headers::content_type::MediaType;
11291135
27, "Expires", "expires", Expires, expires, String; // TODO: Should be Tm
11301136
28, "Last-Modified", "last-modified", LastModified, last_modified, time::Tm;
1131-
1137+
11321138
29, "Access-Control-Allow-Origin", "access-control-allow-origin", AccessControlAllowOrigin, access_control_allow_origin, String;
11331139
}

src/http/rfc2616.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ pub fn is_separator(o: u8) -> bool {
145145
// see https://www.iana.org/assignments/http-parameters/http-parameters.xml
146146

147147
/// Content-coding value tokens
148+
#[deriving(Copy)]
148149
pub enum ContentCoding {
149150
// An encoding format produced by the file compression program "gzip" (GNU zip) as described
150151
// in RFC 1952 [25]. This format is a Lempel-Ziv coding (LZ77) with a 32 bit CRC.
@@ -205,6 +206,7 @@ impl FromStr for ContentCoding {
205206
/// Transfer-coding value tokens
206207
// Identity is in RFC 2616 but is withdrawn in RFC 2616 errata ID 408
207208
// http://www.rfc-editor.org/errata_search.php?rfc=2616&eid=408
209+
#[deriving(Copy)]
208210
pub enum TransferCoding {
209211
Chunked, // RFC 2616, §3.6.1
210212
Gzip, // See above

src/http/server/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ pub trait Server: Send + Clone {
188188
///
189189
/// At present, only the IP address and port to bind to are needed, but it's possible that other
190190
/// options may turn up later.
191+
#[deriving(Copy)]
191192
pub struct Config {
192193
pub bind_address: SocketAddr,
193194
}

0 commit comments

Comments
 (0)