I'd like to capitalize the first letter of a &str. It's a simple problem and I hope for a simple solution. Intuition tells me to do something like this: le
I come from a Java background and I might have something like enum Direction { NORTH, SOUTH, EAST, WEST} and I could do something with each of the values in tur
I'll get error when compiled: 'returns value referencing data owned by the current function' here's the code: fn return_static_str(a: &'st
I am working on a Rust program where I got stuck on a problem that can be reduced to following case: struct Pair<L, R> { left: L, right: R, } // Retu
var fruits = ["Banana", "Orange", "Apple", "Mango"]; var index = fruits.indexOf("Apple"); let fruits = ["Banana", "Orange", "Apple", "Mango"]; let index = fru
I have an 8k buffer of bytes. The data in the first part of the buffer is highly structured, with a set of variables of size u32 and u16. The data in the later
I have a ubuntu machine with multiple users some of whom have and have not root privileges. Above that I have a limited storage for the same machine. I really d
I have a ubuntu machine with multiple users some of whom have and have not root privileges. Above that I have a limited storage for the same machine. I really d
I'm trying to convert the following SQL query into corresponding Rust Diesel code: SELECT COUNT(*) FROM BookStore WHERE BookName IN ('Lord of the Rings', 'Hobbi
I have an api service that has 2 layer: api and repository. The api layer is where the request handling and business logic defined, while repository is a databa
My goal is to have it so when the executable is just double clicked no console spawns but also have it able to print to the console when the user launches it fr
I'm tring to make a native gui app using egui. After some time got the hello_world example to compile.Heres the code: use eframe::{epi, egui}; struct MyEguiApp
Due to how the LGPL works, compiling Rust code to an object file without linking would be useful to be able to do. However, I cannot find any documentation on h
I'm building a web API service with Rust and actix_web. I want to test a route and check if the received response body is what I expect. But I'm struggling with
I'm building a web API service with Rust and actix_web. I want to test a route and check if the received response body is what I expect. But I'm struggling with
I want to write test cases that depend on parameters. My test case should be executed for each parameter and I want to see whether it succeeds or fails for each
I am building my first app with Tauri framework. Basically, I would like to open as embedded "subviews" (as for "IFrame", just to be clear), inside the main pag
I'm trying to use a rustc crate in my program. #[macro_use] extern crate rustc; extern crate rustc_typeck; extern crate syntax; extern crate syntax_pos; use ru
I want to persist the contents of a struct created in one Rust file into a different Rust file. In this minimal reproduction, command line arguments are used to
Like the rust code below: the while loop compiles and runs fine, but for iter version does not compile, due to error: error[E0502]: cannot borrow `v` as mutabl