上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 119 下一页
摘要: 环境 Rust 1.55.0 VSCode 1.59.1 概念 格式化练习,参考资料:https://doc.rust-lang.org/stable/rust-by-example/hello/print/print_display/testcase_list.html 示例 use std::f 阅读全文
posted @ 2021-11-30 22:33 jiangbo4444 阅读(161) 评论(0) 推荐(0)
摘要: 环境 Rust 1.55.0 VSCode 1.59.1 概念 Display 输出使用 {} 来进行打印,Display 主要是面向用户的输出。 如果要实现 display 输出,需要实现 std::fmt::Display 这个 trait。 trait 可以先简单理解为其它编程语言中的接口 示 阅读全文
posted @ 2021-11-30 22:32 jiangbo4444 阅读(863) 评论(0) 推荐(0)
摘要: 环境 Rust 1.55.0 VSCode 1.59.1 概念 Debug 输出使用 {:?} 来进行打印,所有的标准库中的类型,都可以使用 debug 来输出。 Debug 主要是面向程序的输出,一般来说,使用 derive 来自动实现 Debug,使用 {:#?} 来进行美化打印。 如果要实现 阅读全文
posted @ 2021-11-30 22:31 jiangbo4444 阅读(716) 评论(0) 推荐(0)
摘要: 环境 Rust 1.55.0 VSCode 1.59.1 概念 格式化练习,参考资料:https://doc.rust-lang.org/stable/rust-by-example/hello/print/fmt.html 示例 use std::fmt::{self, Display, Form 阅读全文
posted @ 2021-11-30 22:30 jiangbo4444 阅读(245) 评论(0) 推荐(0)
摘要: 环境 Rust 1.54.0 VSCode 1.59.1 参考文档 https://doc.rust-lang.org/stable/rust-by-example/hello/print.html 示例 其中 println! 和 print! 类似,只是多 ln 的会多一个换行,会输出到标准输出 阅读全文
posted @ 2021-11-30 22:29 jiangbo4444 阅读(455) 评论(0) 推荐(0)
摘要: 环境 Rust 1.54.0 VSCode 1.59.1 概念 参考:https://doc.rust-lang.org/stable/rust-by-example/hello/comment.html 文档注释(doc comments):文档注释会对外公开,使用者一般在使用之前,会进行阅读。 阅读全文
posted @ 2021-11-30 22:27 jiangbo4444 阅读(446) 评论(0) 推荐(0)
摘要: 环境 Rust 1.54.0 VSCode 1.59.1 概念 参考:https://doc.rust-lang.org/stable/rust-by-example/hello/comment.html 文档注释(doc comments):文档注释会对外公开,使用者一般在使用之前,会进行阅读。 阅读全文
posted @ 2021-11-30 22:25 jiangbo4444 阅读(403) 评论(0) 推荐(0)
摘要: 环境 Rust 1.54.0 VSCode 1.59.1 概念 参考:https://doc.rust-lang.org/stable/rust-by-example/hello/comment.html 文档注释(doc comments):文档注释会对外公开,使用者一般在使用之前,会进行阅读。 阅读全文
posted @ 2021-11-30 22:24 jiangbo4444 阅读(287) 评论(0) 推荐(0)
摘要: 环境 Rust 1.54.0 VSCode 1.59.1 概念 参考:https://doc.rust-lang.org/stable/rust-by-example/hello/comment.html 块注释(block comments):当代码逻辑很复杂,需要额外说明时,可以使用块注释来帮助 阅读全文
posted @ 2021-11-30 22:20 jiangbo4444 阅读(361) 评论(0) 推荐(0)
摘要: 环境 Rust 1.54.0 VSCode 1.59.1 概念 参考:https://doc.rust-lang.org/stable/rust-by-example/hello/comment.html 行注释(line comments):当代码逻辑很复杂,需要额外说明时,可以使用行注释来帮助人 阅读全文
posted @ 2021-11-30 22:19 jiangbo4444 阅读(132) 评论(0) 推荐(0)
上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 119 下一页