Skip to content
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

[please do not merge] Rewrite one method in rust #787

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Commits on Jun 11, 2024

  1. Rewrite one method in rust

    With much thanks to this blog post:
    https://blog.codeminer42.com/integrating-ruby-with-rust-with-ffi/
    
    In order to deploy this, we would first need to add cargo to the
    lib-jobs boxes (perhaps through apt).
    
    Currently, the code is in a crate of type cdylib, which does not
    support doctests! 😢 I wonder if we could use the cdylib as a
    compatibility layer, and then use a lib crate (with doctests)
    to actually provide the functionality.
    
    We should also make sure we are running the following regularly,
    perhaps as part of CI?
     * `cargo clippy`
     * `cargo test`
     * `cargo fmt`
     * `cargo doc`
    
    I am also confused as to whether or not this contains a memory
    leak.  FFI is returning a two-element array, with our string and
    then a pointer.  But if I try to free the pointer afterwards
    (which I could be doing wrong), I get an error that it hasn't
    been allocated?  Very mysterious (and ironic that we have to
    worry about it when using memory safe languages like Ruby and Rust).
    sandbergja committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    3ffb71f View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2024

  1. Use unwrap_or

    Co-authored-by: Ryan Laddusaw <[email protected]>
    sandbergja and rladdusaw committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    b13ae2d View commit details
    Browse the repository at this point in the history