Skip to content

Commit cb1e6a2

Browse files
committed
book: use mod test consistently
Fixes #24030 Of the four code samples with modules in TRPL: - 2 use `mod test` - 2 use `mod tests` We should be consistent here, but which is right? The stdlib is split: $ grep -r 'mod tests {' src/lib* | wc -l 63 $ grep -r 'mod test {' src/lib* | wc -l 58 Subjectively, I like the plural, but both the language reference and the style guide recommend the singular. So we'll go with that here, for now.
1 parent 80def6c commit cb1e6a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/doc/trpl/benchmark-tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn add_two(a: i32) -> i32 {
1313
}
1414
1515
#[cfg(test)]
16-
mod tests {
16+
mod test {
1717
use super::*;
1818
use test::Bencher;
1919

src/doc/trpl/testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ pub fn add_two(a: i32) -> i32 {
382382
}
383383
384384
#[cfg(test)]
385-
mod tests {
385+
mod test {
386386
use super::*;
387387
388388
#[test]

0 commit comments

Comments
 (0)