]> git.proxmox.com Git - cargo.git/commitdiff
Guide new users to add use `super::*;`
authormerelymyself <poonsters6@gmail.com>
Tue, 24 May 2022 12:27:58 +0000 (20:27 +0800)
committermerelymyself <poonsters6@gmail.com>
Tue, 24 May 2022 12:27:58 +0000 (20:27 +0800)
15 files changed:
src/cargo/ops/cargo_new.rs
tests/testsuite/init/auto_git/out/src/lib.rs
tests/testsuite/init/formats_source/out/src/lib.rs
tests/testsuite/init/fossil_autodetect/out/src/lib.rs
tests/testsuite/init/git_autodetect/out/src/lib.rs
tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs
tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs
tests/testsuite/init/mercurial_autodetect/out/src/lib.rs
tests/testsuite/init/pijul_autodetect/out/src/lib.rs
tests/testsuite/init/simple_git/out/src/lib.rs
tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs
tests/testsuite/init/simple_hg/out/src/lib.rs
tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs
tests/testsuite/init/simple_lib/out/src/lib.rs
tests/testsuite/new.rs

index 0df39321e3f4080a832bc08f7ac787b8276631e4..281eec4aa4b4dd01ece4b651c182002486fe8e1e 100644 (file)
@@ -811,6 +811,8 @@ fn main() {
             b"\
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 059dc12384ea6fec9d20aa48eed79c493e0da754..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,8 +1,10 @@
 #[cfg(test)]
 mod tests {
-  #[test]
-  fn it_works() {
-    let result = 2 + 2;
-    assert_eq!(result, 4);
-  }
+    // Uncomment this to use items from the containing module.
+    // use super::*;
+    #[test]
+    fn it_works() {
+        let result = 2 + 2;
+        assert_eq!(result, 4);
+    }
 }
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index 1b4a90c938387450422982a89aed075aa1e8c010..d4dead2428101388ea6aea5640231f8a6c41fd93 100644 (file)
@@ -1,5 +1,7 @@
 #[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;
index ae23842c14f848b3d8d0836d5c5d01c6f89894d7..1c7abc1b25f9b38577649ed55860937dc4494692 100644 (file)
@@ -41,6 +41,8 @@ fn simple_lib() {
         contents,
         r#"#[cfg(test)]
 mod tests {
+    // Uncomment this to use items from the containing module.
+    // use super::*;
     #[test]
     fn it_works() {
         let result = 2 + 2;