Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @sanders41, I needed your help with this issue I'm facing. I think I'm not handling errors/exceptions correctly in PyO3 as I pass Rust objects back to Python. I'm facing a trait bound error that I'm not sure how to go about fixing.
If you see the
lib.rs
in this branch, the compiler complains about the following:Goal
What I'm trying to accomplish is a bit more than the basic "provide a list of Python file strings as input and get a new set of files as output".
In this piece, I'm trying to make the input to the Rust module a little more generic: I'd like to accept a list of dicts (converted to a type-safe
Vec
ofRecord
s on the Rust end). That way, when calling this function from Python, it doesn't matter whether we obtained the list of dicts in Python from raw files or from a database.That's why the Rust
get_pronoun_counts
function signature is set toVec<Record>
instead of a file like in the pure-Rust version.Here's the Python file I'm trying to run to test whether this logic works:
Expected result
Would you be able to take a look and let me know what I'm missing? Thanks!