|
Curious - how easy is Rust to integrate into F#/Unity?
|
# ¿ Feb 20, 2016 00:16 |
|
|
# ¿ May 2, 2024 17:59 |
|
You need to do this:code:
|
# ¿ Aug 22, 2016 02:35 |
|
Speaking of error-chain, I started using the rust SDL 2 library, which returns some errors as Result<_, String>. What's the most idiomatic way of dealing with those? They work fine by themselves, but I'd like to chain_err them.
|
# ¿ Dec 6, 2016 05:25 |
|
It's saying that the Err type of Result needs to implement error::Error, though. I have an error module available, and I can chain_err on other Results as long as their Err implements error::Error. It's just the ones that return Strings instead of real errors that are causing problems. e: For reference, just in case I'm being real stupid, here's some code that runs into this: code:
code:
Asymmetrikon fucked around with this message at 02:38 on Dec 9, 2016 |
# ¿ Dec 9, 2016 02:29 |
|
Mapping errors sounds good, thanks. They not only use Strings for some errors (errors in init() and Sdl::video), they have an error type UpdateTextureError that doesn't implement Error? It's real weird. Probably going to see if they've done something about that and try to patch it otherwise.
|
# ¿ Dec 9, 2016 02:41 |
|
I think my least favorite thing about refactoring so far has been trying to isolate parts of a chain of iterators. The result of a .map().filter().whatever() has a gnarly result type.
|
# ¿ Jan 3, 2017 19:47 |
|
Filter is parameterized over a P: FnMut, which the compiler just represents as an anonymous closure, though. How do you express that kind of type concretely?
|
# ¿ Jan 3, 2017 21:10 |
|
gonadic io posted:Will 'impl trait' help for this case? Yeah. Is that out of nightly yet?
|
# ¿ Jan 3, 2017 23:56 |
|
|
# ¿ May 2, 2024 17:59 |
|
Has anyone used the Rust IntelliJ plugin with rustup? If so, how do you get it to find the standard library sources? It comes up with an option to download them, and I click on it and it doesn't error out or anything, and I can check that the rust-src component is installed and the rust sources are downloaded, but no matter what I do the plugin doesn't seem able to find them. Even if I manually point it at any of the folders in the source path, it says those are invalid.
|
# ¿ Apr 16, 2017 19:38 |