Tips for Rust Coding
Input {:?} quickly in vim
Add this line into your vimrc:
| |
In vim insert mode, if you try \d, vim will convert that into {:?}.
Find out the type name of specific variable when debugging
Add this line to your code
| |
You will got compile failure with type name of your variable.
Speed up the compiling with lld linker
In Fedora/RHEL/CentOS, you may:
- Add this to you
.bashrc:export RUSTFLAGS="-C link-arg=-fuse-ld=lld" - Install
lld:sudo dnf install lld -y