Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
5 replies
62 views

It's good practice for readable code to specify the actual data type in let assignments, if the right side is complex or misleading. Like: let strange: DataType::<ComplexWorld<f32>> = ...
Jan Diederich's user avatar
2 votes
2 answers
44 views

Does anyone know how to make it work ( without clone() , without excessive boilerplate code, without repeating .a  or .b ( imagine having many such sub-fields in real life code, with large field names,...
Mohit Saini's user avatar
2 votes
1 answer
56 views

I have this snippet that gives me a compile error: fn main() { let mut t = String::from("Hello, world!"); let tt = &mut t; tt.type_id(); } error: error[E0597]: `t` does not ...
Ahmad's user avatar
  • 33
0 votes
0 answers
25 views

Even if I run setTheme("light") in my browser and view the Tauri menu, it remains in the dark theme. The system theme is dark. Is there a way to change the menu theme? import { setTheme } ...
oqiita's user avatar
  • 1
0 votes
1 answer
44 views

From references-change-permissions-on-places, places have three kinds of permission on their data: Read (R): data can be copied to another location. Write (W): data can be mutated. Own (O): data ...
Steven Lu's user avatar
  • 101
0 votes
0 answers
30 views

I am creating a QueryBuilder, so I though that it w'd be amazing to serialize objects to tokens, and have an AST within the QueryBuilder. So I immediatly though about the Visitor Design Pattern. Here'...
Alex Vergara's user avatar
  • 2,335
0 votes
1 answer
48 views

I've tried the rust iced framework and tried to create a markdown view from the documentation and the code compiles and renderes the windows but the code pub fn new() -> Self { Self { ...
devMe's user avatar
  • 499
0 votes
1 answer
73 views

I have the following implementation of to_file for a struct which takes a parameter with AsRef<Path>: pub fn to_file(&self, path: impl AsRef<Path>) -> anyhow::Result<()> { ...
glades's user avatar
  • 5,392
1 vote
0 answers
64 views

I'm using Arch Linux with Wayland. My terminal is Kitty. I'm trying to create an animation using the Kitty Graphics Protocol. However, I want this animation to cover the whole screen and run at 60 fps....
johny's user avatar
  • 41
Best practices
0 votes
2 replies
68 views

Is there a way that I can have a reference to a variable while allowing that variable to be mutated in Rust, so long as I "pinky promise not to access the data of the stored variable" so ...
ViperZer0's user avatar
Best practices
0 votes
4 replies
49 views

I can't help thinking this is not an uncommon idiom and I'm just being an idiot but I've spent ages searching SO and reading the docs for std::iter and for the itertools crate and have got nowhere. ...
Halzephron's user avatar
-2 votes
1 answer
78 views

I'm new learning rust and this is an issue with BufReader.read_line(). In the official documentation it says "This function will read bytes from the underlying stream until the newline delimiter (...
Sun Shuo's user avatar
0 votes
0 answers
56 views

I have a list of elements in an array in which I'm looking for a sequence. Using std::vec::windows::any, I was able to confirm presence/absence of a given sequence. I'm facing an issue if there are ...
Harry's user avatar
  • 4,198
0 votes
0 answers
42 views

I've got a working Rust cross-compile setup on Arch Linux, targeting x86_64-unknown-linux-musl and aarch64-unknown-linux-musl from a x86_64 host. By default, binaries for both targets are fully ...
cyqsimon's user avatar
  • 4,048
6 votes
1 answer
205 views

I am using Rust to target a baremetal system. My startup code is written in Assembly and is in crt0.S, it is shared between Rust, C and Assembly projects. crt0.S contains: #include "constants.h&...
Toby Jaffey's user avatar

15 30 50 per page
1
2 3 4 5
2928