MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / double_first

Function double_first

0a_error_handling/rust/more_boilerplate.rs:47–52  ·  view source on GitHub ↗
(vec: Vec<&str>)

Source from the content-addressed store, hash-verified

45}
46
47fn double_first(vec: Vec<&str>) -> Result<i32> {
48 let first = vec.first().ok_or(DoubleError::EmptyVec)?;
49 let parsed = first.parse::<i32>()?;
50
51 Ok(2 * parsed)
52}
53
54fn print(result: Result<i32>) {
55 match result {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected