use fmt;
use io::{IoResult, IoError};
use iter::{Iterator, IteratorExt};
+use kinds::Copy;
use libc::{c_void, c_int};
use libc;
use boxed::Box;
fn env_convert(input: Vec<Vec<u8>>) -> Vec<(Vec<u8>, Vec<u8>)> {
let mut pairs = Vec::new();
for p in input.iter() {
- let mut it = p.as_slice().splitn(1, |b| *b == b'=');
+ let mut it = p.splitn(1, |b| *b == b'=');
let key = it.next().unwrap().to_vec();
let default: &[u8] = &[];
let val = it.next().unwrap_or(default).to_vec();
pub writer: c_int,
}
+impl Copy for Pipe {}
+
/// Creates a new low-level OS in-memory pipe.
///
/// This function can fail to succeed if there are no more resources available
kind: MemoryMapKind,
}
+#[cfg(not(stage0))]
+impl Copy for MemoryMap {}
+
/// Type of memory map
pub enum MemoryMapKind {
/// Virtual memory map. Usually used to change the permissions of a given
MapVirtual
}
+impl Copy for MemoryMapKind {}
+
/// Options the memory map is created with
pub enum MapOption {
/// The memory should be readable
MapNonStandardFlags(c_int),
}
+impl Copy for MapOption {}
+
/// Possible errors when creating a map.
pub enum MapError {
/// ## The following are POSIX-specific
ErrMapViewOfFile(uint)
}
+impl Copy for MapError {}
+
impl fmt::Show for MapError {
fn fmt(&self, out: &mut fmt::Formatter) -> fmt::Result {
let str = match *self {
#[cfg(unix)]
fn join_paths_unix() {
fn test_eq(input: &[&str], output: &str) -> bool {
- join_paths(input).unwrap().as_slice() == output.as_bytes()
+ join_paths(input).unwrap() == output.as_bytes()
}
assert!(test_eq(&[], ""));
#[cfg(windows)]
fn join_paths_windows() {
fn test_eq(input: &[&str], output: &str) -> bool {
- join_paths(input).unwrap().as_slice() == output.as_bytes()
+ join_paths(input).unwrap() == output.as_bytes()
}
assert!(test_eq(&[], ""));