![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
rust
qiangshou001
这个作者很懒,什么都没留下…
展开
-
cargo install cargo-tree 失败,提示“error: failed to run custom build command for `kernel32-sys v0.2.2`”
error: failed to run custom build command for `libssh2-sys v0.2.6`process didn't exit successfully: `C:\Users\radix\AppData\Local\Temp\cargo-install.FV5LTR5nFsKM\release\build\libssh2-sys-86a416940b...原创 2018-09-05 11:09:48 · 3007 阅读 · 0 评论 -
How to Debug Rust with Visual Studio Code
https://www.forrestthewoods.com/blog/how-to-debug-rust-with-visual-studio-code/Install Rust and VS CodeThis should go without saying.Install RustInstall Visual Studio CodeInstall V...原创 2019-05-24 14:18:20 · 920 阅读 · 0 评论 -
获取丑数 get ugly nums
pub fn nth_ugly_number(n: i32) -> i32 { fn is_ugly_number(n: i32) -> bool { let mut m = n; while m % 5 == 0 { m = m / 5; } while m % 3 == 0 { ...原创 2019-05-24 13:53:46 · 150 阅读 · 0 评论 -
快速排序入门实现,Rust版
Rust实现:fn quick_sort(nums: &mut Vec<u8>, left: usize, right: usize) { if left >= right { return; } let mut l = left; let mut r = right; while l < r ...原创 2019-05-19 11:24:25 · 1777 阅读 · 0 评论 -
hashMap底层实现
参考知乎https://zhuanlan.zhihu.com/p/28501879原创 2019-03-11 14:21:33 · 180 阅读 · 0 评论 -
回文数算法分析
判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。示例 1:输入: 121输出: true示例2:输入: -121输出: false解释: 从左向右读, 为 -121 。 从右向左读, 为 121- 。因此它不是一个回文数。示例 3:输入: 10输出: false解释: 从右向左读, 为 01 。因此它不是一个回文...原创 2019-03-07 09:26:14 · 1389 阅读 · 1 评论 -
rust copy 和 clone 区别
参考资料https://zhuanlan.zhihu.com/p/21730929 总结Copy 和 Clone 两者的区别和联系有:Copy内部没有方法,Clone内部有两个方法。 Copy trait 是给编译器用的,告诉编译器这个类型默认采用 copy 语义,而不是 move 语义。Clone trait 是给程序员用的,我们必须手动调用clone方法,它才能发挥作用。...原创 2019-01-29 17:17:42 · 7161 阅读 · 0 评论 -
install rustup failed, err "it looks like you have an existing installation of Rust"
error: it looks like you have an existing installation of Rust at:error: /home/pnkfelix/binerror: rustup cannot be installed alongside Rust. Please uninstall firsterror: if this is what you wan...原创 2019-01-23 17:46:31 · 1262 阅读 · 0 评论 -
求根函数
平时编码中经常遇到求根函数,比如1024占多少bit,即求 值为多少?为此编写一个小程序,方便使用,语言为Rust,仅供参考: fn rooting(base: f64, num: f64) -> f64 { let mut quotient = num / base; let mut ret = 0.0; while quotient > 1.0 ...原创 2018-12-28 10:56:53 · 2019 阅读 · 0 评论 -
cargo build failed: SSL connect error (schannel: failed to receive handshake, SSL/TLS connection fai
➜ rust-demo git:(dag_blockchain) ✗ cargo build➜ rust-demo git:(dag_blockchain) ✗ cargo builderror: failed to download from `https://crates.io/api/v1/crates/rand/0.6.1/downl ...原创 2018-12-11 11:20:46 · 13050 阅读 · 3 评论 -
ubuntu: cargo build error: failed to run custom build command for `openssl-sys v0.9.39`
cargo build error: failed to run custom build command for `openssl-sys v0.9.39` 解决方法:1. 输入命令“sudo apt install libssl-dev” 安装最新的 libssl 包;sudo apt install libssl-dev 2.输入命令“sudo r...原创 2018-12-14 09:39:46 · 6671 阅读 · 2 评论 -
WebAssembly && 编译原理
WebAssembly 系列(一)生动形象地介绍 WebAssemblyhttps://www.w3ctech.com/topic/2027WebAssembly 系列(三)编译器如何生成汇编https://www.w3ctech.com/topic/2025原创 2018-11-26 16:33:19 · 266 阅读 · 0 评论 -
cygwin 使用 zsh
命令窗口输入 ls -a 打开.bashrc,并将 /usr/bin/zsh 插入.bashrc,将zsh设置为默认 输入 wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh 安装oh-my-zsh; 安装成功,重启cygwin,即可。...原创 2018-09-21 18:25:19 · 825 阅读 · 1 评论 -
rust hashmap使用总结
https://blog.csdn.net/wowotuo/article/details/74779709use std::collections::HashMap;fn hashmap_test() { let mut contacts = HashMap::new(); for i in 1..10 { contacts.insert(i, (i *...原创 2018-09-21 11:02:06 · 8198 阅读 · 0 评论 -
ubuntu 16.04 虚拟机中 git pull 出错 sign_and_send_pubkey: signing failed: agent refused operation
osboxes@ubuntu:~/user$ git pullsign_and_send_pubkey: signing failed: agent refused operationPermission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the...原创 2018-09-21 09:16:49 · 336 阅读 · 0 评论 -
ubuntu 16.04 安装 docker教程
1.下载安装 VMware Workstation;2.VMware Workstation中创建ubuntu虚拟机,版本 16.04,下载地址https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/16.04/ubuntu-16.04.5-desktop-amd64.iso3.在安装好的ubuntu虚拟机中按照如下帖子中的方法,傻瓜式操作...原创 2018-09-19 10:39:39 · 214 阅读 · 0 评论