librustc: Remove remaining uses of &fn() in favor of ||.

This commit is contained in:
Patrick Walton 2013-11-19 17:36:32 -08:00
parent 406813957b
commit 9e610573ba
72 changed files with 163 additions and 153 deletions

View file

@ -335,7 +335,7 @@ fn mkdir(path: &Path) {
/// things like ".." to components which preserve the "top down" hierarchy of a
/// static HTML tree.
// FIXME (#9639): The closure should deal with &[u8] instead of &str
fn clean_srcpath(src: &[u8], f: &fn(&str)) {
fn clean_srcpath(src: &[u8], f: |&str|) {
let p = Path::new(src);
if p.as_vec() != bytes!(".") {
for c in p.str_components().map(|x|x.unwrap()) {
@ -645,7 +645,7 @@ impl<'self> Cache {
impl Context {
/// Recurse in the directory structure and change the "root path" to make
/// sure it always points to the top (relatively)
fn recurse<T>(&mut self, s: ~str, f: &fn(&mut Context) -> T) -> T {
fn recurse<T>(&mut self, s: ~str, f: |&mut Context| -> T) -> T {
if s.len() == 0 {
fail!("what {:?}", self);
}
@ -768,7 +768,7 @@ impl Context {
/// all sub-items which need to be rendered.
///
/// The rendering driver uses this closure to queue up more work.
fn item(&mut self, item: clean::Item, f: &fn(&mut Context, clean::Item)) {
fn item(&mut self, item: clean::Item, f: |&mut Context, clean::Item|) {
fn render(w: io::File, cx: &mut Context, it: &clean::Item,
pushname: bool) {
// A little unfortunate that this is done like this, but it sure