dbg: excessive logging
This commit is contained in:
parent
eee6a76c69
commit
1c176d4f73
1 changed files with 21 additions and 6 deletions
27
src/lib.rs
27
src/lib.rs
|
@ -1,3 +1,4 @@
|
||||||
|
use std::num::ParseIntError;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
// This is what Wolves returns to us
|
// This is what Wolves returns to us
|
||||||
|
@ -201,6 +202,7 @@ impl Client {
|
||||||
/// # })
|
/// # })
|
||||||
/// ```
|
/// ```
|
||||||
pub async fn get_member(self, email: &str) -> Option<i64> {
|
pub async fn get_member(self, email: &str) -> Option<i64> {
|
||||||
|
dbg!(&self.base_key);
|
||||||
// if the key isnt set then we cant do anything.
|
// if the key isnt set then we cant do anything.
|
||||||
let api_key = match &self.base_key {
|
let api_key = match &self.base_key {
|
||||||
None => {
|
None => {
|
||||||
|
@ -210,7 +212,7 @@ impl Client {
|
||||||
};
|
};
|
||||||
|
|
||||||
let url = format!("{}/get_id_from_email", &self.base_wolves);
|
let url = format!("{}/get_id_from_email", &self.base_wolves);
|
||||||
|
dbg!(&url);
|
||||||
match reqwest::Client::new()
|
match reqwest::Client::new()
|
||||||
.post(&url)
|
.post(&url)
|
||||||
.form(&[("email", email)])
|
.form(&[("email", email)])
|
||||||
|
@ -219,13 +221,26 @@ impl Client {
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(x) => {
|
Ok(x) => {
|
||||||
if let Ok(y) = x.json::<WolvesResultSingle<WolvesUserExists>>().await {
|
match x.json::<WolvesResultSingle<WolvesUserExists>>().await {
|
||||||
// this is the only time we will get a positive response, the None at the end catches everything else
|
Ok(y) => {
|
||||||
if let WolvesUserExists::S(z) = y.result {
|
// this is the only time we will get a positive response, the None at the end catches everything else
|
||||||
if let Ok(id) = z.parse::<i64>() {
|
match y.result {
|
||||||
return Some(id);
|
WolvesUserExists::B(e) => {dbg!(e);}
|
||||||
|
WolvesUserExists::S(z) => {
|
||||||
|
match z.parse::<i64>() {
|
||||||
|
Ok(id) => {
|
||||||
|
return Some(id);
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
dbg!(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Err(e) => {
|
||||||
|
dbg!(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
Loading…
Reference in a new issue