【Rust日报】 2019-05-25:Mockiato - 一個嚴格友好的Mock測試庫

    xiaoxiao2023-11-19  157

    Into The Wild

    有人用rust寫了一個很像lf2(Little Fighter 2)的2.5D動作遊戲

    Read more

    Rust官网的国际化支持,在找人翻译

    Read more Read more

    「讨论」对于单人主力维护的项目如何看待

    楼主覺得 actix 和 rust-postgres 很棒

    但發現這兩個庫都只有一個大佬在當主力開發,他覺得庫只有一人維護對大公司來說不是問題

    但對無力繼續維護的小客戶來說是個問題,大家覺得呢?

    (其实很多项目都是单人在撑)

    Read more

    hors 0.3.0

    一個類似 google search 找解答的工具

    howdoi 的 rust 實作版本

    比如你有個問題叫 “how to parse json in rust”

    使用下列指令

    hors "how to parse json in rust" -a

    得到解答

    - Answer from https://stackoverflow.com/questions/30292752/how-do-i-parse-a-json-file Solved by the many helpful members of the Rust community: extern crate rustc_serialize; use rustc_serialize::json::Json; use std::fs::File; use std::io::Read; fn main() { let mut file = File::open("text.json").unwrap(); let mut data = String::new(); file.read_to_string(&mut data).unwrap(); let json = Json::from_str(&data).unwrap(); println!("{}", json.find_path(&["Address", "Street"]).unwrap()); }

    Read more

    Mockiato :一個嚴格友好的Mock測試庫

    對測試有需求的同學可以試試看

    #[cfg(test)] use mockiato::mockable; #[cfg_attr(test, mockable)] trait Greeter { fn greet(&self, name: &str) -> String; } #[cfg(test)] mod tests { use super::*; #[test] fn greet_the_world() { let mut greeter = GreeterMock::new(); greeter .expect_greet(|arg| arg.partial_eq("world")) .returns(String::from("Hello world")); assert_eq!("Hello world", greeter.greet("world")); } }

    Read more

    cargo-cache 0.2.1

    這個工具可以幫助你管理 ~/.cargo/ 或 ${CARGO_HOME}

    Cargo cache '/home/matthias/.cargo': Total size: 7.22 GB Size of 101 installed binaries: 909.51 MB Size of registry: 1.46 GB Size of registry index: 63.65 MB Size of 3082 crate archives: 435.72 MB Size of 2038 crate source checkouts: 963.10 MB Size of git db: 4.84 GB Size of 107 bare git repos: 980.81 MB Size of 100 git repo checkouts: 3.86 GB cargo cache query "^serde*" Registry cache sorted by name: serde-0.6.15: 16988 serde-0.7.15: 22719 serde-0.8.23: 25824 [...] Registry source cache sorted by name: serde-0.8.23: 168461 serde-1.0.80: 477759 serde-1.0.82: 485084

    Read more


    From 日报小组 @Damody

    日报订阅地址:

    独立日报订阅地址:

    Telgram Channel阿里云语雀订阅SteemitGitHub

    社区学习交流平台订阅:

    Rust.cc论坛: 支持rssRust Force: 支持rss微信公众号:Rust语言学习交流
    最新回复(0)