Category "rust"

If two mutable references aren’t allowed simultaneously, why are they allowed at all?

According to the documentation, Data races cause undefined behavior and can be difficult to diagnose and fix when you’re trying to track them down at run

Module parse failed for wasm module generated by rust wasm-pack

I have been following this tutorial: https://developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_wasm in order to build a Rust library and use it in a VueJS pr

How to unzip a Reqwest/Hyper response using streams?

I need to download a 60MB ZIP file and extract the only file that comes within it. I want to download it and extract it using streams. How can I achieve this us

How do I implement an async Drop in Rust?

I have an async fn that returns a type, and want to implement Drop on that type that calls another async function. It's not clear how to do this, and I can't fi

How to avoid dependency on libssl.so.10 and libcrypto.so.10

My handy little rust binary is working just fine when compiled and run on pretty much every system except the Ubuntu 18.04 I need it to run on. Why, you might a

How to setup default rust compilation target on CI using rustup command on github actions?

I need to compile my code for both 32 and 64 bit windows. As far as I understand, I basically need to configure my CI so that this command: rustup default print

How to test system that requires Time resource?

I want to write tests for system that moves entities and detects collisions, system uses Res<Time> to ensure that entities move with constant speed. I was

Rust nightly not installed, please install it

I was able to build and run substrate-node-template from the instructions from the cloned repo, following the instructions at https://substrate.dev/docs/en/tuto

How do I pass a Go callback (function ptr) from Go to Rust via CGo?

I have: A Rust library that is compiled to a static C library A Go program that calls the Rust library's API via CGo I wish to pass a Go function (as callback)

Using String.replace to replace a multi-line section of the string in Rust

I am trying to use Rust to go through and make changes to an HTML file. Basically, I find specific things in the code that I want replaced, then I replace it w

How to re-run Diesel migrations?

I'm using Diesel with PostgreSQL. I added my migrations, and they worked fine, outputting everything in the schema.rs file. Until I noticed that I was missing t

error: component 'clippy' for target {target} is unavailable for download

When using a custom rust-toolchain file with a pinned version 1.59.0 and running cargo clippy in 1.59.0, I get error: the 'cargo-clippy' binary, normally provi

Rust installation fails on Linux with error "OS 21"

When I tried to install Rust on my Linux machine this error appeared:error: could not amend shell profile: '/home/$Username/.profile': could not write rcfile fi

Corrupted .gif download file using rust but without rust using curl command it works

Hi I tried to download a .gif file using curl command in Linux fedora 36 using curl https://static.wikia.nocookie.net/minecraft_gamepedia/images/d/d1/Magma_Bloc

How to Use String instead of ObjectId in "wither" Rust?

I have this code here: pub struct Account { #[serde(rename = "_id", skip_serializing_if = "Option::is_none")] pub id: Option<ObjectId>, pub em

How to Use String instead of ObjectId in "wither" Rust?

I have this code here: pub struct Account { #[serde(rename = "_id", skip_serializing_if = "Option::is_none")] pub id: Option<ObjectId>, pub em

How do you run the main binary and then run tests based on it in Rust?

I have written a webserver which requires some complicated setup and teardown, and am trying to write unit tests. Axum does provide examples using the Tower One

How do I separate the execution of tests via cargo test?

I'm working on a Rust project that has many units test (almost 200). About 20 of those tests are really heavy and they create problems when executed with the ot

Use rust cargo to run tests in workspace root

I've got the following rust project layout: project_name ├── crate_1 │ ├── src │ │ ...

I cant install cargo afl due to conflict libc in build

i run this command for installing afl but got this error :slight_smile: cargo install --force afl --verbose Updating crates.io index Installing afl v0.12.2 Comp