I\'d like to mark functions/methods as deprecated. I tried to apply the deprecated
attribute:
#[deprecated]
fn old_way_of_doing_it() {
<
Since Rust 1.9.0 (2016 May 26th) you can use the #[deprecated]
attribute in your own crates (RFC 1270). The syntax is:
#[deprecated(since="0.5.0", note="please use `new_method` instead")]
pub fn old_method() { ..; }
It will throw the following warning whenever you use old_method
:
:6:5: 6:15 warning: use of deprecated item: please use `new_method` instead, #[warn(deprecated)] on by default
:6 old_method()
^~~~~~~~~~
You may find more information in the RFC.