web: Remove debug comments

Signed-off-by: Ben Aaron Goldberg <ben@benaaron.dev>
This commit is contained in:
Ben Aaron Goldberg 2021-10-24 05:43:06 -04:00
parent b6182eb317
commit 0fa50fad47

View file

@ -33,7 +33,6 @@ async fn create_link(
settings: web::Data<InstanceSettings>, settings: web::Data<InstanceSettings>,
form: web::Form<HashMap<String, String>>, form: web::Form<HashMap<String, String>>,
) -> Result<impl Responder> { ) -> Result<impl Responder> {
eprintln!("create {:?}", form);
let mut weights = vec![0; settings.pronoun_list.len()]; let mut weights = vec![0; settings.pronoun_list.len()];
for (k, v) in form.iter() { for (k, v) in form.iter() {
if let Ok(i) = k.parse::<usize>() { if let Ok(i) = k.parse::<usize>() {
@ -44,9 +43,7 @@ async fn create_link(
} }
} }
let prefs = InstanceSettings::create_preferences(&weights); let prefs = InstanceSettings::create_preferences(&weights);
eprintln!("prefs: {:?}", prefs);
let pref_string = prefs.as_prefstring(); let pref_string = prefs.as_prefstring();
eprintln!("prefstring: {}", pref_string);
let url = match form.get("name") { let url = match form.get("name") {
Some(name) if !name.is_empty() => format!("/{}/{}", name, pref_string), Some(name) if !name.is_empty() => format!("/{}/{}", name, pref_string),
_ => format!("/{}", pref_string), _ => format!("/{}", pref_string),
@ -58,7 +55,6 @@ async fn create_link(
#[get("/")] #[get("/")]
async fn default(settings: web::Data<InstanceSettings>) -> Result<impl Responder> { async fn default(settings: web::Data<InstanceSettings>) -> Result<impl Responder> {
eprintln!("default");
let pronoun = settings let pronoun = settings
.select_pronouns(None, None) .select_pronouns(None, None)
.map_err(|_| Error::InvlaidPrefString)?; .map_err(|_| Error::InvlaidPrefString)?;
@ -72,7 +68,6 @@ async fn only_prefs(
web::Path(prefs): web::Path<String>, web::Path(prefs): web::Path<String>,
settings: web::Data<InstanceSettings>, settings: web::Data<InstanceSettings>,
) -> Result<impl Responder> { ) -> Result<impl Responder> {
eprintln!("prefs {}", prefs);
let pronoun = settings let pronoun = settings
.select_pronouns(None, Some(&prefs)) .select_pronouns(None, Some(&prefs))
.map_err(|_| Error::InvlaidPrefString)?; .map_err(|_| Error::InvlaidPrefString)?;
@ -86,7 +81,6 @@ async fn prefs_and_name(
web::Path((name, prefs)): web::Path<(String, String)>, web::Path((name, prefs)): web::Path<(String, String)>,
settings: web::Data<InstanceSettings>, settings: web::Data<InstanceSettings>,
) -> Result<impl Responder> { ) -> Result<impl Responder> {
eprintln!("prefs+name");
let pronoun = settings let pronoun = settings
.select_pronouns(Some(&name), Some(&prefs)) .select_pronouns(Some(&name), Some(&prefs))
.map_err(|_| Error::InvlaidPrefString)?; .map_err(|_| Error::InvlaidPrefString)?;