這是一個更高級別的問題,但我不確定哪些Rust功能應該用於改進問題。 採取的第一個步驟寫具有工具 API的圖形應用程序中,我們可能希望在context參數,它暴露了應用程序的各個部分通: // Where the data lives.
struct Application {
preferences: Preferences,
windows: Vec<Windows>,
我試圖在Rust中使用Snowball stemmer箱子來幹掉一個單詞向量。它應該是簡單的,但借檢查一直拒絕我的代碼: // Read user input
let input = stdin();
let mut stemmer = Stemmer::new("english").unwrap();
for line in input.lock().lines() {
let