Declare aliases for Rust constructs with ease!
toml
[dependencies]
pseudonym = "0.2.0"
In the following examples the items to which the macro is attached to get generated as aliases using the passed identifier.
```rust
fn verylongfunction_name() { // ... }
fn main () { short_name(); // use the alias! } ```
```rust
struct S (i32); ```
```rust
trait T {} ```
```rust
struct S;
impl S { fn new() -> Self { S } } ```
Sometimes, you'll need to create aliases to old functions which are deprecated.
pseudonym
allows you to deprecate aliases using the same syntax as deprecated
.
```rust use pseudonym::alias;
deprecated(
old_api_function,
since = "0.1.0",
note = "This function has been deprecated in favor of `new_api_function`"
)
))] fn newapifunction() { // ... }
fn main () { short_name(); // use the alias! } ```
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.