Skip to content

Commit d9170e1

Browse files
committed
Tidy
1 parent d38939c commit d9170e1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/libstd/net_tcp.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,9 @@ fn listen_common(host_ip: ip::IpAddr, port: uint, backlog: uint,
809809
* A buffered wrapper that you can cast as an `io::reader` or `io::writer`
810810
*/
811811
pub fn socket_buf(sock: TcpSocket) -> TcpSocketBuf {
812-
TcpSocketBuf(@TcpBufferedSocketData { sock: move sock, mut buf: ~[], buf_off: 0 })
812+
TcpSocketBuf(@TcpBufferedSocketData {
813+
sock: move sock, mut buf: ~[], buf_off: 0
814+
})
813815
}
814816

815817
/// Convenience methods extending `net::tcp::tcp_socket`
@@ -865,19 +867,19 @@ impl TcpSocketBuf: io::Reader {
865867
loop {
866868
assert count < len;
867869

868-
// If possible, copy up to `len` bytes from the internal
870+
// If possible, copy up to `len` bytes from the internal
869871
// `data.buf` into `buf`
870872
let nbuffered = self.data.buf.len() - self.data.buf_off;
871873
let needed = len - count;
872874
if nbuffered > 0 {
873875
unsafe {
874-
let ncopy = uint::min(nbuffered, needed);
876+
let ncopy = uint::min(nbuffered, needed);
875877
let dst = ptr::mut_offset(
876878
vec::raw::to_mut_ptr(buf), count);
877879
let src = ptr::const_offset(
878880
vec::raw::to_const_ptr(self.data.buf),
879881
self.data.buf_off);
880-
ptr::copy_memory(dst, src, ncopy);
882+
ptr::copy_memory(dst, src, ncopy);
881883
self.data.buf_off += ncopy;
882884
count += ncopy;
883885
}
@@ -905,7 +907,7 @@ impl TcpSocketBuf: io::Reader {
905907
err_data.err_name, err_data.err_msg);
906908
// As we have already copied data into result buffer,
907909
// we cannot simply return 0 here. Instead the error
908-
// should show up in a later call to read().
910+
// should show up in a later call to read().
909911
break;
910912
}
911913
}
@@ -1872,7 +1874,8 @@ pub mod test {
18721874
cont_ch.send(());
18731875
let sock = result::unwrap(move accept_result);
18741876
let peer_addr = sock.get_peer_addr();
1875-
debug!("SERVER: successfully accepted connection from %s:%u",
1877+
debug!("SERVER: successfully accepted \
1878+
connection from %s:%u",
18761879
ip::format_addr(&peer_addr),
18771880
ip::get_port(&peer_addr));
18781881
let received_req_bytes = read(&sock, 0u);

0 commit comments

Comments
 (0)