This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pytest-rs/crates $ cargo nextest run -j 8 --workspace | |
Finished test [unoptimized + debuginfo] target(s) in 0.06s | |
Starting 44 tests across 6 binaries | |
PASS [ 0.045s] lexarg tests::short_opt_equals_sign | |
PASS [ 0.039s] lexarg tests::test_basic | |
PASS [ 0.049s] lexarg tests::short_opt_equals_sign_invalid | |
PASS [ 0.049s] lexarg tests::test_combined | |
PASS [ 0.051s] lexarg tests::test_dash_args | |
PASS [ 0.057s] lexarg tests::test_invalid_long_option | |
PASS [ 0.065s] lexarg tests::test_invalid_short_option |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
autosnippets = { | |
NeogitCommitMessage = {}, | |
all = {}, | |
c = {}, | |
cobol = {}, | |
cpp = {}, | |
cs = {}, | |
csharp = {}, | |
css = {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
相同的colorschema,vim和gvim的颜色差距还是很大的,因为gvim使用X的颜色,而vim只能使用终端提供的颜色,所以造成了二者的显示差异。 | |
xterm开启256色 | |
现在的终端模拟器早就支持256色了,不过默认可能还是8色的。 | |
开启xterm终端,查看xterm终端支持的颜色 | |
命令: | |
$ tput colors | |
8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm pub_visibility -rf | |
cargo new pub_visibility -q | |
cd pub_visibility/ | |
cargo_build() { | |
cargo b --release -q | |
echo "before strip:" | |
ls -lh target/release/pub_visibility | |
strip target/release/pub_visibility |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(let_chains)] | |
#![feature(cow_is_borrowed)] | |
use std::borrow::Cow; | |
fn main() { | |
helper_upper_ascii(&mut String::from("hello")); | |
helper_upper_ascii(&mut String::from("World")); | |
helper_upper_ascii(&mut String::from("ßγ")); | |
helper_upper_ascii(&mut String::from("你好")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// you need this in your cargo.toml | |
// reqwest = { version = "0.11.3", features = ["stream"] } | |
// futures-util = "0.3.14" | |
// indicatif = "0.15.0" | |
use std::cmp::min; | |
use std::fs::File; | |
use std::io::Write; | |
use reqwest::Client; | |
use indicatif::{ProgressBar, ProgressStyle}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug)] | |
struct User { id: u32, pid: u32, name: String, } | |
fn set_up_option() -> Vec<Option<User>> { | |
// 注意修改了顺序 | |
vec![Some(User { id: 0, pid: 1, name: "admin1".to_string(), }), | |
Some(User { id: 2, pid: 2, name: "admin3".to_string(), }), | |
Some(User { id: 1, pid: 1, name: "admin2".to_string(), }), | |
Some(User { id: 3, pid: 2, name: "admin4".to_string(), })] | |
} |