Skip to content

Commit

Permalink
Updated test rs fn code a little
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Moore <[email protected]>
  • Loading branch information
jimmyaxod committed Oct 6, 2023
1 parent 5e7f745 commit 2c00156
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ext/fn_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ pub fn scale(ctx: Option<&mut types::Context>) -> Result<Option<types::Context>,

let fetcher = New(c);

if fetcher.is_err() {
// Return an error...
if let Err(e) = fetcher {
let val = ctx.unwrap();
val.my_string = "Error New err".to_string();
val.my_string = format!("Error New err {e}");
return signature::next(Some(val));
}

Expand All @@ -26,22 +25,20 @@ pub fn scale(ctx: Option<&mut types::Context>) -> Result<Option<types::Context>,
return signature::next(Some(val));
}


let res = f.unwrap().Fetch(fetch::ConnectionDetails{ url: "https://ifconfig.me".to_string() });

if res.is_err() {
// Return an error...
if let Err(e) = res {
let val = ctx.unwrap();
val.my_string = "Error res err".to_string();
val.my_string = format!("Error Fetch err {e}");
return signature::next(Some(val));
}

let f1 = res.unwrap();

if f1.is_none() {
// Return an error...
let val = ctx.unwrap();
val.my_string = "Error res none".to_string();
val.my_string = "Error Fetch none".to_string();
return signature::next(Some(val));
}

Expand Down

0 comments on commit 2c00156

Please sign in to comment.