hrxi
hrxi
I'm willing to implement any of these solutions or one that you come up with. :)
I just ran into more clippy suggestions where it doesn't improve performance: ``` String::from_utf8(vec).or(Err(Enum::InvalidUtf8)) ``` Or a couple of others, the pattern is the same, `.or(EnumVariant(PlainOldData))`. Changing this to `or_else`...
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8df0162a2915322edfefceb3ca706ca7 ```rust #![warn(clippy::or_fun_call)] use std::borrow::Cow; fn foo() -> Result
It seems you're not compiling with optimizations (`-O`). I shortened the code a little and get equivalent assembly, the `or_else` version even seems (inconsequentially) longer: https://rust.godbolt.org/z/cj1EYhv4a
I also hit this while packaging libnghttp2 for wrapdb: https://github.com/mesonbuild/wrapdb/pull/1221.
Does this happen in the beginning only? Or does it happen for a prolonged period of time?
This is presumably the following TODO: https://github.com/nimiq/jsonrpc/blob/41d26fc1aa4fffde2ded7d4c187c9d693a588aed/nimiq-jsonrpc-client/src/websocket.rs#L59-L61.
> @dtolnay Could you try `std::mem::take(&mut pending).into_iter()`? That also destroys the capacity because it replaces the old vector with an empty one that doesn't have any capacity.
Fixed by #1976.
For me, ibus works with dino for switching the keyboard layout (e.g. between a latin and a cyrillic layout) but not for complex IMEs like for inputting japanese using anthy.