apply_pub

Crates.ioapply_pub
lib.rsapply_pub
version0.0.2
sourcesrc
created_at2014-11-24 00:08:46.348702
updated_at2015-12-11 23:57:25.953017
descriptionA Rust syntax extension for applying the `pub` visibility modifer to many items at once.
homepage
repositoryhttps://github.com/Kimundi/apply-pub-rs
max_upload_size
id378
size11,879
Marvin Löbel (Kimundi)

documentation

http://rust-ci.org/Kimundi/apply-pub-rs/doc/apply-pub-rs/

README

apply-pub-rs

A Rust syntax extension for applying the pub visibility modifer to many items at once.

Right now the attribute applies to every possible child AST element that could have public visibility, including:

  • use
  • static
  • fn, both standalone and methods/associated ones
  • mod
  • type, struct and enum
  • trait
  • symbols in extern {} blocks.

Example

Add this to your Cargo.toml:

[dependencies.apply-pub-rs]
git = "https://github.com/Kimundi/apply-pub-rs"

To load the extension and use it:

#![feature(phase)]

#[phase(plugin)]
extern crate apply_pub;

#[apply_pub]
mod foo {
    fn bar() {}
    mod baz {
        fn qux() {}
    }
}

fn main() {
    foo::bar();
    foo::baz::qux();
}
Commit count: 15

cargo fmt