drop_guard 0.3.0

The drop_guard crate enables you to implement the Drop trait on any type. So you can run a closure on any value running out of scope.
Documentation
use drop_guard::guard;

fn main() {
    let s = String::from("a commonString");
    let mut s = guard(s, |final_string| {
        println!("s became {} at last", final_string)
    });

    // much code and time passes by ...
    *s = "a rainbow".to_string();

    // by the end of this function the String will have become a rainbow
}