-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add not (yet) supported test case involving tuples (#7)
- Loading branch information
Showing
6 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "tuple_values" | ||
version = "0.1.0" | ||
authors = ["Felix Wittwer <[email protected]>"] | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
mod ohua_runtime; | ||
mod tuples; | ||
|
||
fn main() { | ||
let (num, text, num2) = ohua_runtime::ohua_main(String::from("The number is zero."), 42); | ||
|
||
println!("Number: {} (84), string: {}, number 2: {}", num, text, num2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pub fn append_to_string(input_string: String, input_number: i32) -> String { | ||
input_string.replace("zero", input_number.to_string().as_str()) | ||
} | ||
|
||
pub fn extend_string(intermediate: String) -> String { | ||
intermediate + " Or is it?" | ||
} | ||
|
||
pub fn output_values(input_number: i32, extended_string: String) -> (i32, String, usize) { | ||
let length = extended_string.len(); | ||
(input_number, extended_string, length) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ns some_ns; | ||
|
||
use sf tuples (append_to_string, extend_string, output_values); | ||
|
||
fn main(input_number: i32, input_string: String) -> (i32, String, usize) { | ||
let intermediate = append_to_string(input_string, input_number); | ||
let extended = extend_string(intermediate); | ||
output_values(input_number, extended) | ||
} |