Custom Rust Toolchains

I recently set up a new computer and needed to create a rustup toolchain for my local build of the Rust compiler. Everytime I do this, I have to Google it so I’m leaving this here for future reference: Linux $ rustup toolchain link stage0 ~/code/rust/rust/build/x86_64-unknown-linux-gnu/stage0 $ rustup toolchain link stage1 ~/code/rust/rust/build/x86_64-unknown-linux-gnu/stage1 $ rustup toolchain link stage2 ~/code/rust/rust/build/x86_64-unknown-linux-gnu/stage2 macOS $ rustup toolchain link stage0 ~/code/rust/rust/build/x86_64-apple-darwin/stage0 $ rustup toolchain link stage1 ~/code/rust/rust/build/x86_64-apple-darwin/stage1 $ rustup toolchain link stage2 ~/code/rust/rust/build/x86_64-apple-darwin/stage2 I usually put my Rust projects in ~/code/rust/ so you may need to adjust the paths for your computer. [Read More]

Announcing process_path

process_path is a crate that makes it easy to get the path of the currently executing process. Thanks to Geoffroy Couprie for the idea! take this, make it in a new useful library, be awesome: https://t.co/4aDY9wp9Np you have until I get back from vacation ;) — Geoffroy Couprie (@gcouprie) December 22, 2016 The library currently provides one function: pub fn get_executable_path() -> Option<PathBuf>; The library uses various platform specific APIs to find the appropriate path rather than relying on argv[0] and supports the following platforms: [Read More]

Unicode MesssageBox example in Rust

In this post, I’ll show you how to use the Unicode version of the MessageBox api we used in the previous post. The end result should look something like this: To get started, we’ll use the previous version of the code which you can find here. The first thing we need to do is find the correct version of the MessageBox() function to call. As I mentioned previously, there are two versions of the function: MessageBoxA() for ASCII and MessageBoxW() for Unicode. [Read More]

Fix VsCode Vim not repeating on OS X

If you’re like me, the first thing you did after installing Visual Studio Code on your Mac was to install the Vim plugin without completely reading the Readme file. There is a helpful command listed at the bottom of the Readme that you’ll need to run in your Terminal in order to get keys to repeat when you are in Normal mode: defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false If you are using the Insider version of Visual Studio Code, then you’ll need to use this instead: [Read More]

Hello World MesssageBox example in Rust

In this post, I’ll show you how to use the winapi crate to display a simple MessageBox on Windows. I’ll also describe the process I used to come up with the code. The end result should look something like this: To get started, let’s create a new project using Cargo: cargo new --bin hello_world This will create a new folder called hello_world in your current working directory. The --bin argument tells Cargo that compiling this project will result in an executable (. [Read More]