Add an assert to opts::set_opts.

This function leaks if called more than once.
This commit is contained in:
Brian Anderson 2015-05-09 02:11:18 -07:00
parent 17747ad0e2
commit 8975a3bd9b

View file

@ -425,6 +425,7 @@ static mut OPTIONS: *mut Opts = 0 as *mut Opts;
pub fn set_opts(opts: Opts) {
unsafe {
assert!(OPTIONS.is_null());
let box_opts = box opts;
OPTIONS = mem::transmute(box_opts);
}