Skip to content

Kimundi/apply-pub-rs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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();
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages