We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4784201 commit e2035ebCopy full SHA for e2035eb
2 files changed
src/lib.rs
@@ -0,0 +1,14 @@
1
+/// Hello from Magrathea
2
+pub fn answer() -> u32 {
3
+ 42
4
+}
5
+
6
+#[cfg(test)]
7
+mod tests {
8
+ use super::*;
9
10
+ #[test]
11
+ fn deep_thought_test() {
12
+ assert_eq!(answer(), 42);
13
+ }
14
src/main.rs
@@ -1,18 +1,6 @@
fn main() {
- println!("The answer to the ultimate question is {}", answer());
-}
-
-/// Hello from Magrathea
-fn answer() -> u32 {
- 42
-#[cfg(test)]
-mod tests {
- use super::*;
- #[test]
15
- fn deep_thought_test() {
16
- assert_eq!(answer(), 42);
17
- }
+ println!(
+ "The answer to the ultimate question is {}",
+ rust_gh_example::answer()
+ );
18
}
0 commit comments