Dan Gohman
48fb3a79ef
Add use super::*; to unit-test examples.
...
rust-lang/cargo#10706 switched the `cargo init --lib`-generated src/lib.rs
to use a function and `use super::*;` inside the `mod test`. This makes
it easier for new users to write their own functions and add tests, as it
means the tests can refer to the new functions without any extra work, and
without rustc asking them to add explicit `use`s for each new thing they add.
This PR updates the parts of the book that use this src/lib.rs and
similar examples, to match the new output of `cargo init --lib`, and to
additionally help guide users to using `use super::*;` inside their
`mod test`s.
There is one non-example change, which is to update the wording in
src/ch11-01-writing-tests.md to better reflect the new content in the
associated example.
2022-11-10 16:29:15 -08:00
..
2021-07-08 21:43:57 -04:00
2018-11-20 13:45:05 -05:00
2022-06-19 21:06:50 -04:00
2022-06-08 10:02:35 -04:00
2022-06-08 10:01:05 -04:00
2022-10-20 16:39:55 -04:00
2021-12-26 20:32:41 -05:00
2022-10-20 16:49:55 -04:00
2020-06-02 08:33:02 -05:00
2022-10-20 16:39:55 -04:00
2018-11-20 13:45:05 -05:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2021-11-19 17:06:19 -05:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-27 16:00:51 -04:00
2022-10-27 16:00:51 -04:00
2022-10-27 16:00:51 -04:00
2022-10-27 16:00:51 -04:00
2022-10-28 16:42:57 -04:00
2022-10-28 16:42:57 -04:00
2022-10-28 16:42:57 -04:00
2022-10-28 16:42:57 -04:00
2022-05-20 22:06:38 -04:00
2022-05-20 22:06:38 -04:00
2022-07-04 20:50:43 -04:00
2022-06-17 15:22:13 -04:00
2022-05-20 22:06:38 -04:00
2022-06-17 15:22:13 -04:00
2022-01-11 16:04:41 -05:00
2022-05-29 20:28:20 -04:00
2022-10-20 16:39:55 -04:00
2022-07-04 20:36:25 -04:00
2022-01-21 22:14:59 -05:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-05-30 21:07:29 -04:00
2022-06-01 21:35:13 -04:00
2022-07-04 20:37:56 -04:00
2022-07-04 21:05:33 -04:00
2022-06-14 20:02:00 -04:00
2022-04-12 21:14:47 -04:00
2022-11-10 16:29:15 -08:00
2022-06-02 21:16:43 -04:00
2022-06-02 21:45:23 -04:00
2022-06-03 21:10:24 -04:00
2022-06-03 21:10:24 -04:00
2022-06-03 21:10:24 -04:00
2022-07-14 21:33:04 -04:00
2022-04-27 21:24:49 -04:00
2022-06-03 21:10:24 -04:00
2022-06-03 21:10:24 -04:00
2022-06-10 22:11:56 -04:00
2022-07-14 20:31:33 -04:00
2022-09-08 10:47:24 -04:00
2022-06-10 22:11:56 -04:00
2021-07-05 13:41:08 -04:00
2022-04-29 10:03:00 -04:00
2022-04-29 10:03:00 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2019-06-14 14:54:17 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2022-09-06 10:21:25 -04:00
2022-10-20 16:39:55 -04:00
2022-04-30 14:15:33 -04:00
2022-10-20 16:39:55 -04:00
2022-10-20 16:39:55 -04:00
2018-11-20 13:45:05 -05:00
2022-09-12 22:41:11 +02:00
2022-07-19 21:03:20 -04:00
2022-10-20 16:39:55 -04:00
2022-05-02 10:18:36 -04:00
2022-06-07 11:14:59 -04:00
2022-06-07 11:14:59 -04:00
2022-05-28 21:01:53 -04:00
2022-06-07 11:16:36 -04:00
2022-06-13 21:05:32 -04:00
2022-05-21 20:31:44 -04:00
2022-05-21 20:31:44 -04:00
2022-06-13 21:05:32 -04:00
2022-05-22 22:20:25 -04:00
2022-06-28 12:10:26 -04:00
2022-06-16 21:27:25 -04:00
2022-06-16 21:27:25 -04:00
2022-05-22 22:20:25 -04:00
2022-06-16 21:27:25 -04:00
2022-06-07 21:46:10 -04:00
2022-06-07 21:46:10 -04:00
2022-08-18 21:15:06 -04:00
2022-06-28 12:08:11 -04:00
2018-11-20 13:45:05 -05:00
2022-06-10 22:11:56 -04:00
2022-11-03 22:13:58 -04:00