- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Add an example to the FFI guide #19968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
        
          
                src/doc/guide-ffi.md
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/of/off/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅
ed67534    to
    d94c620      
    Compare
  
            
          
                src/doc/guide-ffi.md
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer to drop the "C" wherever possible as it's the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting. @aturon do we have any convention here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aturon says no official one, but:
steve@warmachine:~/src/rust$ git grep 'extern {' | wc -l
253
steve@warmachine:~/src/rust$ git grep 'extern "C" {' | wc -l
25So, seems legit. :)
| @steveklabnik ping | 
| This has now been updated to be on the book, and I fixed the style issue. @alexcrichton r? | 
        
          
                src/doc/trpl/ffi.md
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/"C"//
| @alexcrichton both nits fixed | 
Add an example to the FFI guide Reviewed-by: alexcrichton
Add an example to the FFI guide Reviewed-by: alexcrichton
| Doing this manually as part of #21300 | 
This is a little short, but the FFI guide needs a cohesive go-over, and this at least adds the information in the meantime.
It also modernizes the style in a small way, by moving the tilde syntax to the grave syntax.