mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit c26d20100758152210e0a6e77d765b77f4e413a8
parent 804f022e7a23ffe3aa0d03b0853d9a71d4ba5182
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Fri,  2 Apr 2021 12:28:04 +0200

format; remove resolved TODOs

Diffstat:
Msrc/mail.rs | 8++++----
Msrc/main.rs | 6+-----
2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/mail.rs b/src/mail.rs @@ -2,10 +2,10 @@ use anyhow::Result; use askama::Template; use tide::Request; -use std::fs; use std::borrow::Cow; +use std::fs; -use mailparse::{parse_mail, ParsedMail, MailHeaderMap}; +use mailparse::{parse_mail, MailHeaderMap, ParsedMail}; /* Mail related routes */ // TODO create a thread object, a collection of references to emails @@ -17,13 +17,13 @@ struct ListThreadsTemplate { } struct Email { - subject: String + subject: String, } impl Email { fn from_parsed(mail: &ParsedMail) -> Result<Self> { Ok(Email { - subject: mail.headers.get_first_value("Subject").unwrap() + subject: mail.headers.get_first_value("Subject").unwrap(), }) } } diff --git a/src/main.rs b/src/main.rs @@ -309,7 +309,6 @@ struct RepoTreeTemplate<'a> { } async fn repo_tree(req: Request<()>) -> tide::Result { - // TODO handle subtrees let repo = repo_from_request(&req.param("repo_name")?)?; if repo.is_empty().unwrap() { // redirect to start page of repo @@ -318,7 +317,6 @@ async fn repo_tree(req: Request<()>) -> tide::Result { return Ok(tide::Redirect::temporary(url.to_string()).into()); } - // TODO accept reference or commit id let head = repo.head()?; let spec = req.param("ref").ok().or_else(|| head.shorthand()).unwrap(); let commit = repo.revparse_single(spec)?.peel_to_commit()?; @@ -399,7 +397,6 @@ async fn repo_commit(req: Request<()>) -> tide::Result { find_options.all(true); diff.find_similar(Some(&mut find_options)).unwrap(); - // TODO accept reference or commit id let tmpl = RepoCommitTemplate { repo: &repo, commit, @@ -418,9 +415,8 @@ struct RepoFileTemplate<'a> { } async fn repo_file(req: Request<()>) -> tide::Result { - // TODO renmae for clarity + // TODO rename for clarity let repo = repo_from_request(req.param("repo_name")?)?; - // If directory -- show tree TODO let head = repo.head()?; let spec = req.param("ref").ok().or_else(|| head.shorthand()).unwrap(); let commit = repo.revparse_single(spec)?.peel_to_commit()?;