use std::io::prelude::*; use std::fs::File; use std::io::BufWriter; use std::io::BufReader; fn main() { let file = File::open("./ico.txt").unwrap(); let mut fin = BufReader::new(...
参考https://huangjj27.gitlab.io/posts/rust-mirrorhttps://doc.rust-lang.org/cargo/reference/source-replacement.htmlhttps://lug.ustc.edu.cn/wiki/mirrors/help/rust-crateshttps://github.com/rustcc/lernae...
本文代码 https://github.com/tothis/rust-record/tree/main/cli/file-append-newlineCargo.toml[package] name = "file-append-newline" version = "0.1.0" authors = ["Li Lei <this.l...
Rust 日期时间命令行工具本文代码 https://github.com/tothis/rust-record/tree/main/cli/time当前日期和时间戳cargo run解析时间cargo run "2020-02-20 02:04:08.000"解析时间戳cargo run 1582135448000Cargo.toml[package] name = "time&...
本文代码 https://github.com/tothis/rust-record/tree/main/test/ssh2Cargo.toml[package] name = "ssh2-record" version = "0.1.0" edition = "2018" [dependencies] ssh2 = "...
增加依赖:easy="*"use curl::easy::Easy; use std::fs::File; use std::io::Write; fn main() { let source_url = "https://pic.3gbizhi.com/2019/0927/20190927085959737.jpeg"; let collect:Vec...
rust base64 例子base64 = "0.12.1"use base64::{encode, decode}; fn main() { let a = b"hello world"; let b = "aGVsbG8gd29ybGQ="; assert_eq!(encode(a), b); assert...
rust md5 加密库Cargo.toml 增加依赖rust-crypto = "^0.2" use crypto::digest::Digest; use crypto::md5::Md5; pub fn md5<S:Into<String>>(input: S) -> String { let mut md5 = Md5...
rust zip库使用Cargo.toml增加依赖zip = "0.5.5"压缩目录使用walkdir = "2"use std::fs; use std::fs::File; use std::io::{copy, Read, Seek, Write}; use std::path::Path; use std::str; use walkdir::{DirEntry, WalkDir...
use std::{env, process}; fn main() { let a = vec![ String::from("hello"), String::from("world"), ]; println!("size of vector is :{}"...