You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a lot of unsafe code you often find yourself having to make just some parts of your functions unsafe, however the requirement to use unsafe blocks often makes it nicer to just wrap the function body in unsafe {}.
I want to propose allowing bracketless unsafe for making a single expression unsafe, for example retrieving a global variable require code like this:
let a = unsafe{ global.get()};
This could be rewritten to:
let a = unsafe global.get();
It also becomes usefule when matching on globals:
matchunsafe{ global }{
...}// vsmatchunsafe global {
...}
The text was updated successfully, but these errors were encountered:
When writing a lot of unsafe code you often find yourself having to make just some parts of your functions unsafe, however the requirement to use unsafe blocks often makes it nicer to just wrap the function body in
unsafe {}
.I want to propose allowing bracketless
unsafe
for making a single expression unsafe, for example retrieving a global variable require code like this:This could be rewritten to:
It also becomes usefule when matching on globals:
The text was updated successfully, but these errors were encountered: