returns a value referencing data owned by the current function [1]

Error:

I'm still new to rust, and I don't know how to create a copy from refs, or transfer ownership.

Code details:

let result = check_email(&input).await;
let myresult = result.first().unwrap();
let responce = EmailOutput {
    input: &myresult.input,
    is_reachable: Reachable::from_str(format!("{:?}",myresult.is_reachable).as_str()),
    misc: Misc { is_disposable: myresult.misc.as_ref().unwrap().is_disposable, is_role_account: myresult.misc.as_ref().unwrap().is_role_account },
    mx: format!("{:?}", myresult.mx),
    smtp: Smtp { can_connect_smtp: myresult.smtp.as_ref().unwrap().can_connect_smtp, has_full_inbox: myresult.smtp.as_ref().unwrap().has_full_inbox, is_catch_all: myresult.smtp.as_ref().unwrap().is_catch_all, is_deliverable: myresult.smtp.as_ref().unwrap().is_deliverable, is_disabled: myresult.smtp.as_ref().unwrap().is_disabled },
    syntax: Syntax { address: myresult.syntax.address.as_ref().unwrap().to_string(), domain: myresult.syntax.domain.as_ref(), is_valid_syntax: myresult.syntax.is_valid_syntax, username: &myresult.syntax.username }
  };
let output = Box::new(responce);
  
  
Ok(Json(&*output))

error details

code details



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations