I was trying to install trunk for learning yew, but it keeps failing because lightningcss fails to compile: error: could not compile `lightningcss` (lib) due to 61 previous errors warning: build failed, waiting for other jobs to finish... error:…
Looking for anyone who has tried this approach and can either provide a "won't work" or "good idea" experience. Background I'm currently working on a crate & app which (initially) targets windows and includes custom ffi bindings to provide hardware…
Just thought it was odd that there was no retain equivalent that uses swap_remove under the hood. Why not add something like this? fn retain_unordered<T, F>(vec: &mut Vec<T>, mut keep: F) where F: FnMut(&T) -> bool, { let mut i = 0; while i <…
Hey folks, I'm using the Snowball compiler to generate a Rust implementation of our stemmer. This involves copying a couple of modules into my project. Unfortunately Clippy is not happy with one of the modules, and I don't feel confident modifying…
How do you treat changes to default settings for your library's configuration? Are you strict and consider them part of your API or are you more lax and allow changes to the default settings within a major version? My concrete use case looks similar…
Pre-RFC: global_generic — crate-level type parameters Summary Add a global_generic declaration that lets a crate expose a type parameter which is bound exactly once, in main.rs, and then used anywhere in the dependency graph as if it were a concrete…
I'm looking for ways to have str representations of ranges of integers without allocating. My current best attempt is to manually match on each value: match i { 0 => "0", 1 => "1", 2 => "2", ... n => "n" } which works, but has the obvious problem of…
I'm trying to write a test and running into a problem. Here's the code: fn test_mix3parts_1(plain:&[u8],cipher:&[u8]) { let mut text_copy=plain.clone(); let len=plain.len(); let third=len/3; let rprime=find_max_order(third as u64) as usize;…
I have a crate with some common types in it, and various crates that depend on it and use these common types. If I push the common types into the dependencies, I end up with a cyclic dependency graph, and cargo build will not function (which is a…
The following situation happens often: I have a wrapper type around a multidimensional array. I want to make the type generic over the specific dimensions. I want to pack all dimensions into one parameter, so that large generic trees don't have…
hi, I'm having trouble with type constraints. In this example into() fails but casting with as works: fn example() { let a: u64 = 0; let b: f64 = a.into(); // Error - From<u64> not satisifed let c: f64 = a as f64; // Works } I have a generic…
I have a struct of two u64's, and the code that tries ref_from_bytes, crashes, even though alignment is 8, and the slice is a multiple of 8. Even if I try a slice multiple of 16 (336..352 instead of 328..344), it still shows the same error message.…
Sorry for the noob question. But I need to use &str, but can't find a way to concatenate it to return a value. I don't know how to implement the as_str() or just & here as instructed here. (click for more details) (click for more details) 12 posts -…