Update deps

This commit is contained in:
Pascal Engélibert 2026-07-25 20:12:48 +02:00
commit 39ebfcb1db
4 changed files with 754 additions and 639 deletions

View file

@ -1,25 +1,15 @@
use crate::{
cache,
config::Config,
repo::{ReadRepoMetadataError, RepoMetadataEntry},
templates,
};
use crate::{cache, config::Config, repo::ReadRepoMetadataError, templates};
use askama::Template;
use async_lock::Mutex;
use log::error;
use std::{
collections::{BTreeMap, BTreeSet, HashMap},
io::{ErrorKind, Read},
path::PathBuf,
};
use trillium::{Conn, Handler};
use trillium_router::{Router, RouterConnExt};
pub async fn hello_world(conn: Conn) -> Conn {
conn.ok("hello world!")
}
pub fn make_router(config: &'static Config) -> impl Handler {
let mut hl_registry = giallo::Registry::builtin().unwrap();
hl_registry.link_grammars();
@ -45,10 +35,11 @@ pub fn make_router(config: &'static Config) -> impl Handler {
conn.ok(crate::templates::Home {}.render().unwrap())
})
.post("/fetch", move |mut conn: Conn| async move {
if let Ok(request_body) = conn.request_body().await.with_max_len(8192).await {
if let Ok(request_body) = conn.request_body().with_max_len(8192).read_bytes().await
{
let mut repo_url = None;
let mut commit_hash = None;
for (key, val) in form_urlencoded::parse(request_body.as_bytes()) {
for (key, val) in form_urlencoded::parse(&request_body) {
match key.as_ref() {
"repo-url" => {
repo_url = Some(val);