上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 465 下一页
摘要: This lesson shows how to use a Rust loop to run a program infinitely. use std::io; use std::process; fn main() { loop { println!("Please enter a first 阅读全文
posted @ 2024-02-23 14:39 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: In this lesson we'll learn how to exit a program using the std::process module in Rust and it's exit() method. use std::io; use std::process; fn main( 阅读全文
posted @ 2024-02-23 14:38 Zhentiw 阅读(10) 评论(0) 推荐(0) 编辑
摘要: In this lesson we'll explore how to unwrap a Result type using a language feature called Pattern Matching. use std::io; fn main() { let mut first = St 阅读全文
posted @ 2024-02-23 14:33 Zhentiw 阅读(2) 评论(0) 推荐(0) 编辑
摘要: This lesson discusses how to improve error handling by configuring custom error messages using the expect() function. use std::io; fn main() { let mut 阅读全文
posted @ 2024-02-23 14:29 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: use std::path::PathBuf; use clap::Parser; #[derive(Parser, Debug)] #[clap()] pub struct Opts { pub args: Vec<String>, #[clap(short = 'c', long = "conf 阅读全文
posted @ 2024-02-21 15:51 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要: In this lesson you'll learn about Vec<T>, or Vectors. Vectors are like Arrays, a collection of values of the same type, but as opposed to Arrays, Vect 阅读全文
posted @ 2024-02-20 22:36 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: In this lesson we take a look at Arrays and the different ways of creating them. Arrays in Rust are collections of values of the same type that cannot 阅读全文
posted @ 2024-02-20 22:32 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: Learn how to create references in Rust using the borrow-operator & and when they are useful. For a more thorough explanation of references and their c 阅读全文
posted @ 2024-02-20 22:29 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Everything in Rust has a type. Even functions that don't seem to return anything. In such and similar cases, we're dealing with a Unit Type. Learn abo 阅读全文
posted @ 2024-02-20 22:15 Zhentiw 阅读(7) 评论(0) 推荐(0) 编辑
摘要: fn get_input() -> &'static str { return "..##....... #...#...#.. .#....#..#. ..#.#...#.# .#...##..#. ..#.##..... .#.#.#....# .#........# #.##...#... # 阅读全文
posted @ 2024-02-20 15:42 Zhentiw 阅读(13) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 465 下一页