~erutuon/enwiktionary-translations-server

c821935f43d6013f5d3edc99c9281f723391f392 — Erutuon 1 year, 5 months ago bceeffb master
apply Clippy recommendations
2 files changed, 4 insertions(+), 4 deletions(-)

M src/query.rs
M src/utils.rs
M src/query.rs => src/query.rs +3 -3
@@ 167,15 167,15 @@ pub trait TableResponse: Sized + Send + Sync + Serialize {
                if let Some(cv) = req.state().get_from_cache(&cache_key).await {
                    cache_value = cv;
                    let CacheValue { json, table } = &*cache_value;
                    break (None, Cow::Borrowed(&*table), Cow::Borrowed(&*json));
                    break (None, Cow::Borrowed(table), Cow::Borrowed(json));
                }
            }
            debug!("No response in cache for {args:?}");
            let rows = {
                let db = req.state().db.lock().await;
                args.get_rows(&*db)?
                args.get_rows(&db)?
            };
            let table = args.make_table(&rows, &*req.state().language_code_to_name)?;
            let table = args.make_table(&rows, &req.state().language_code_to_name)?;
            let json = serde_json::to_string(&DataResponse { data: &rows })?;
            break (Some(rows), Cow::Owned(table), Cow::Owned(json));
        };

M src/utils.rs => src/utils.rs +1 -1
@@ 296,7 296,7 @@ impl<'a> Display for TermLink<'a> {
                            "/by-term-and-language?{}",
                            // Have to use serde_urlencoded because serde_qs serializes this as
                            // 0[0]=term&0[1]=term_here&1[0]=language&1[1]=code_here.
                            serde_urlencoded::to_string(&[("term", term), ("language", language)])
                            serde_urlencoded::to_string([("term", term), ("language", language)])
                                .unwrap()
                        ),
                        text: term,