rust-lang-cn / rust-by-example-cn Goto Github PK
View Code? Open in Web Editor NEWRust By Example 中文版(包含在线代码编辑器)
Home Page: http://rustwiki.org/zh-CN/rust-by-example
License: Apache License 2.0
Rust By Example 中文版(包含在线代码编辑器)
Home Page: http://rustwiki.org/zh-CN/rust-by-example
License: Apache License 2.0
The enum keyword allows the creation of a type which may be one of a few different variants.
这句中 variant 可翻译为变种。
在 7.2.1嵌套循环和标签
里面,下面这个句子似乎不太通顺
并且标签必须给 break/continue 语句通过(the label must be passed to the break/continue statement.)
感觉pass应该翻译成传递
更合适
并且标签必须传递给break/continue 语句。
如题
建议改下网页里代码注释的字体样式,这样太难看了,很多字不仔细看跟本认不出
$ git clone https://github.com/rust-lang-cn/rust-by-example-cn
$ cd rust-by-example-cn
$ cargo install mdbook
$ mdbook --version
mdBook v0.2.0
$ mdbook build
2018-08-22 22:28:57 [WARN] (mdbook::config): It looks like you are using the legacy book.toml format.
2018-08-22 22:28:57 [WARN] (mdbook::config): We'll parse it for now, but you should probably convert to the new format.
2018-08-22 22:28:57 [WARN] (mdbook::config): See the mdbook documentation for more details, although as a rule of thumb
2018-08-22 22:28:57 [WARN] (mdbook::config): just move all top level configuration entries like title
, author
and
2018-08-22 22:28:57 [WARN] (mdbook::config): description
under a table called [book]
, move the destination
entry
2018-08-22 22:28:57 [WARN] (mdbook::config): from [output.html]
, renamed to build-dir
, under a table called
2018-08-22 22:28:57 [WARN] (mdbook::config): [build]
, and it should all work.
2018-08-22 22:28:57 [WARN] (mdbook::config): Documentation: http://rust-lang-nursery.github.io/mdBook/format/config.html
2018-08-22 22:28:57 [INFO] (mdbook::book): Book building has started
2018-08-22 22:28:57 [INFO] (mdbook::book): Running the html backend
$ mdbook serve
打开后的页面是没有css的,打开console看到
book.css store.js 404以及book.js中有报错
https://www.rustwiki.org.cn/zh-CN/rust-by-example/fn/closures/closure_examples/iter_any.html
我是在上面的地址观看的,发现有些小笔误,想要修正的时发现github上面是改正的了。
如果我的地址没有问题,希望可以同步下,谢谢。
rust-by-example-cn/src/flow_control/match.md
···
match number {
// 匹配单个值
1 => println!("One!"),
// 匹配多个值
2 | 3 | 5 | 7 | 11 => println!("This is a prime"),
// 匹配一个闭区间范围
13...19 => println!("A teen"),
// 处理其他情况
_ => println!("Ain't special"),
}
···
应为为:
···
match number {
// 匹配单个值
1 => println!("One!"),
// 匹配多个值
2 | 3 | 5 | 7 | 11 => println!("This is a prime"),
// 匹配一个闭区间范围
13..=19 => println!("A teen"),
// 处理其他情况
_ => println!("Ain't special"),
}
···
请修复。谢谢!
例如:https://rustwiki.org/zh-CN/rust-by-example/error/option_unwrap.html
查看原始文件发现可能是换行导致的,如果这不是期望的结果,我可以写一个脚本处理并检查一下其他章节
在18.4.4中
type Result = std::result::Result<T, Boxerror::Error>;
应该是type Result = std::result::Result<T, Box>;
F: FnMut(Self::Item) -> bool {}
// 译注:原文说 `Self::Item` 表明变量是通过值传递给闭包的,这是说错了。
// `FnMut` 就表示闭包只能通过引用捕获变量。把类型为 `T` 的变量作为闭包
// 的参数不代表闭包会拿走它的值,也可能是拿走它的引用。
个人认为原文说得没错。FnMut只是针对该函数的捕获。但是下面的例子也表明了,值和引用都可以作为参数。
RALL 章节中 Initiallization 应为 Initialization
// 通过这个属性屏蔽警告。
#[allow(non_camel_case_types)]
type u64_t = u64;
// 试一试 ^ 移除上面那个属性
请问移除此属性变化是什么呢,我不管注不注释#[allow(non_camel_case_types)]都是输出5 nanoseconds + 2 inches = 7 unit?
请问这是为什么呢
https://rustwiki.org/zh-CN/rust-by-example/
在Chrome中无法访问了,最近几天都是这个情况
感谢您的辛勤工作!!
如題,rustwiki.org
的憑證於 4/30 過期,應儘速更新
如题
您好,在From
和Into
一节内容中的第一段后半部分原文为:If you are able to convert type A from type B, then it should be easy to believe that we should be able to convert type B to type A. 应该都是再说B转换到A,我认为翻译为:如果我们能够从类型B得到类型A,那么很容易相信我们也能把类型B转换为类型A。会更加合理。望采纳。
如何生成pdf,epub,放在手机上看?
如果我们能够从类型 A 得到类型 B,那么很容易相信我们也能把类型 B 转换为类型 A。
应该更正:
如果我们能够从类型 A 得到类型 B,那么很容易相信我们也能把类型 A 转换为类型 B。
This is only suggestion.
I'm a contributer of Japanese translation of RBE, and worked to merge Japanese translation into the official repository.
I think merging into the official has some advantages than the independent repository.
If you are interesting in this suggestion, please see https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING.md.
I can support you, if you have any question.
源代码:
let array1 = [1, 2, 3];
let array2 = [4, 5, 6];
// 对数组的 `iter()` 举出 `&i32`。
println!("2 in array1: {}", array1.iter().any(|&x| x == 2));
// 对数组的 `into_iter()` 通常举出 `&i32`。
println!("2 in array2: {}", array2.iter().any(|&x| x == 2));
正确代码:
let array1 = [1, 2, 3];
let array2 = [4, 5, 6];
// 对数组的 `iter()` 举出 `&i32`。
println!("2 in array1: {}", array1.iter().any(|&x| x == 2));
// 对数组的 `into_iter()` 通常举出 `i32`。
println!("2 in array2: {}", array2.into_iter().any(|x| x == 2));
➜ rust-by-example-cn git:(master) ✗ make pdf
node_modules/.bin/gitbook pdf stage
(node:3132) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Starting build ...
Need to install ebook-convert from Calibre
make: *** [pdf] Error 255
➜ rust-by-example-cn git:(master) ✗ node -v
v6.9.5
我不想把node版本降版本为v5.xx。该怎么解决这个问题?
谢谢
🙏 rustwasm
中文翻译文档代码段:
// 结构体可以作为另一个结构体的字段
#[allow(dead_code)]
struct Rectangle {
p1: Point,
p2: Point,
}
英文文档代码:
// Structs can be reused as fields of another struct
#[allow(dead_code)]
struct Rectangle {
// A rectangle can be specified by where the top left and bottom right
// corners are in space.
top_left: Point,
bottom_right: Point,
}
问题:中文翻译Rectangle p1 p2 字段未能表达出长方形点的释义,动手试一试例题无法开展
在 theme/index.hbs 中 有 Edit 按钮
<i id="edit-button" class="fa fa-edit">Edit</i>
但是我 clone 了 本项目 ,
mdbook serve
or mdbook build
Edit 并没有出现, Search 按钮出现了
是 mdbook 层面的问题?
这两天网站无法访问,手机访问时提示证书过期
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.