Update for rust-nightly
match the result instead of ugly as_ref() call