fabricedesre / cc3200-rs

Getting Rust to run on a TI cc3200
Mozilla Public License 2.0
7 stars 2 forks source link

Fix call to wlan_connect #43

Closed dhylands closed 7 years ago

dhylands commented 7 years ago

When you call Option::map() it creates copy of the object that Option is wrapping. So if you take a reference of that you're getting a reference to a temporary object. Calling Option::as_ref() gives you an Option<&T>, i.e. a reference directly to the object contained in the Option, and when you call .map() on that it makes a copy of the reference, which doesn't introduce a temporary.

fabricedesre commented 7 years ago

r+