Prototypes & Examples in part index.md #7
subject_text/vec/index.md
Lines 17 to 33 in c52caca844
```prototype |
|
/// Add the last two numbers of the input slice. |
|
/// |
|
/// If the slice is not large enough, return `None` |
|
/// If it is, return the computed value in a `Some` |
|
pub fn add_last_two(v: &[f32]) -> Option<f32> { |
|
unimplemented!() |
|
} |
|
``` |
|
```example |
|
fn main() { |
|
assert_eq!(add_last_two(&[]), None); |
|
assert_eq!(add_last_two(&[10.0]), None); |
|
assert_eq!(add_last_two(&[1.0, 2.0, 3.0]), Some(5.0)); |
|
} |
|
``` |
https://gitea.lilymonade.fr/lilymonade/exowos/src/commit/c52caca8449c5fa0a83bcca522f7f31370166623/subject_text/vec/index.md?display=source#L17-L33
vec-finish #9
vec-finish (#9)
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?