Skip to content

Commit 7dcc066

Browse files
committed
Remove unused std::routine
1 parent 679a2c0 commit 7dcc066

File tree

3 files changed

+5
-50
lines changed

3 files changed

+5
-50
lines changed

src/libextra/c_vec.rs

+5-21
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
*/
3838

3939
use std::ptr;
40-
use std::routine::Runnable;
4140
use std::util;
4241

4342
/**
@@ -50,7 +49,7 @@ pub struct CVec<T> {
5049
}
5150

5251
struct DtorRes {
53-
dtor: Option<~Runnable>,
52+
dtor: Option<proc()>,
5453
}
5554

5655
#[unsafe_destructor]
@@ -59,13 +58,13 @@ impl Drop for DtorRes {
5958
let dtor = util::replace(&mut self.dtor, None);
6059
match dtor {
6160
None => (),
62-
Some(f) => f.run()
61+
Some(f) => f()
6362
}
6463
}
6564
}
6665

6766
impl DtorRes {
68-
fn new(dtor: Option<~Runnable>) -> DtorRes {
67+
fn new(dtor: Option<proc()>) -> DtorRes {
6968
DtorRes {
7069
dtor: dtor,
7170
}
@@ -103,7 +102,7 @@ pub unsafe fn CVec<T>(base: *mut T, len: uint) -> CVec<T> {
103102
* * dtor - A function to run when the value is destructed, useful
104103
* for freeing the buffer, etc.
105104
*/
106-
pub unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: ~Runnable)
105+
pub unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: proc())
107106
-> CVec<T> {
108107
return CVec{
109108
base: base,
@@ -155,19 +154,6 @@ mod tests {
155154

156155
use std::libc::*;
157156
use std::libc;
158-
use std::routine::Runnable;
159-
160-
struct LibcFree {
161-
mem: *c_void,
162-
}
163-
164-
impl Runnable for LibcFree {
165-
fn run(~self) {
166-
unsafe {
167-
libc::free(self.mem)
168-
}
169-
}
170-
}
171157

172158
fn malloc(n: size_t) -> CVec<u8> {
173159
unsafe {
@@ -177,9 +163,7 @@ mod tests {
177163

178164
return c_vec_with_dtor(mem as *mut u8,
179165
n as uint,
180-
~LibcFree {
181-
mem: mem,
182-
} as ~Runnable);
166+
proc() unsafe { libc::free(mem); });
183167
}
184168
}
185169

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ pub mod reflect;
192192
pub mod condition;
193193
pub mod logging;
194194
pub mod util;
195-
pub mod routine;
196195
pub mod mem;
197196

198197

src/libstd/routine.rs

-28
This file was deleted.

0 commit comments

Comments
 (0)