As_str for integers
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,…
Daily edition · Rust
TILens turns technical updates into a focused daily brief: official releases, trusted reporting, and practitioner analysis, deduplicated and organized by topic.
28 articles · 4 sources ·
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,…
use asset_importer::{Importer, Vector3D}; use bytemuck::{Pod, Zeroable, cast_slice}; use clap::{Parser, Subcommand}; use glam::{Vec2, Vec3}; use speedy::Writable; #[derive(Parser)] #[command(name = "")] #[command(about…
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…
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…
(topic deleted by author) 1 post - 1 participant Read full topic
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…
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; //…
Showing 1 day · 28 items available