mygit

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

commit 4633c394e46247bc3d7b900c323741f6c91be311
parent 3c8631fb91ec6194634eec79032c1a811fd3862d
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Sat,  3 Apr 2021 14:10:50 +0200

remove unnecessary dependencies and features

resolves todo #30

Diffstat:
MCargo.lock | 96+++----------------------------------------------------------------------------
MCargo.toml | 12+++++++-----
Msrc/mail.rs | 3+--
Msrc/main.rs | 1-
4 files changed, 11 insertions(+), 101 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -67,12 +67,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cddc5f91628367664cc7c69714ff08deee8a3efc54623011c772544d7b2767" [[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] name = "arrayvec" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -115,13 +109,10 @@ dependencies = [ "askama_escape", "humansize", "nom", - "num-traits", "percent-encoding", "proc-macro2", "quote", - "serde", "syn", - "toml", ] [[package]] @@ -268,27 +259,6 @@ dependencies = [ ] [[package]] -name = "async-session" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345022a2eed092cd105cc1b26fd61c341e100bd5fcbbd792df4baf31c2cc631f" -dependencies = [ - "anyhow", - "async-std", - "async-trait", - "base64 0.12.3", - "bincode", - "blake3", - "chrono", - "hmac 0.8.1", - "kv-log-macro", - "rand 0.7.3", - "serde", - "serde_json", - "sha2", -] - -[[package]] name = "async-sse" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -416,21 +386,6 @@ dependencies = [ ] [[package]] -name = "blake3" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if 0.1.10", - "constant_time_eq", - "crypto-mac 0.8.0", - "digest", -] - -[[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -521,7 +476,6 @@ dependencies = [ "libc", "num-integer", "num-traits", - "serde", "time 0.1.44", "winapi", ] @@ -551,12 +505,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" [[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] name = "cookie" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -565,7 +513,7 @@ dependencies = [ "aes-gcm", "base64 0.13.0", "hkdf", - "hmac 0.10.1", + "hmac", "percent-encoding", "rand 0.8.3", "sha2", @@ -629,16 +577,6 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "crypto-mac" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" @@ -940,17 +878,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" dependencies = [ "digest", - "hmac 0.10.1", -] - -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest", + "hmac", ] [[package]] @@ -959,7 +887,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ - "crypto-mac 0.10.0", + "crypto-mac", "digest", ] @@ -1144,12 +1072,6 @@ dependencies = [ ] [[package]] -name = "linked-hash-map" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" - -[[package]] name = "log" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1202,7 +1124,6 @@ dependencies = [ name = "mygit" version = "0.1.0" dependencies = [ - "anyhow", "askama", "askama_tide", "async-std", @@ -1834,7 +1755,6 @@ dependencies = [ "serde_derive", "serde_json", "walkdir", - "yaml-rust", ] [[package]] @@ -1870,7 +1790,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c459573f0dd2cc734b539047f57489ea875af8ee950860ded20cf93a79a1dee0" dependencies = [ "async-h1", - "async-session", "async-sse", "async-std", "async-trait", @@ -2213,12 +2132,3 @@ name = "xml-rs" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] diff --git a/Cargo.toml b/Cargo.toml @@ -8,19 +8,21 @@ license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0" -askama = {version = "0.10", features = ["with-tide"]} +# not using features config and num-traits +askama = { version = "0.10", default-features = false, features = ["humansize", "urlencode", "with-tide"] } askama_tide = "0.13" async-std = { version = "1.8.0", features = ["attributes"] } async-trait = "0.1.48" chrono = "0.4" -git2 = {version="0.13", default-features = false} +git2 = { version="0.13", default-features = false } mailparse = "0.13" once_cell = "1.7.2" percent-encoding = "2.1" pico-args = "0.4" pulldown-cmark = "0.8" serde = { version = "1.0", features = ["derive"] } -syntect = "4.5" -tide = "0.16" +# not using features dump-create and yaml-load +syntect = { version = "4.5", default-features = false, features = ["assets", "dump-load", "html", "parsing", "regex-onig"] } +# not using feeatures cookies and sessions +tide = { version = "0.16", default-features = false, features = ["h1-server", "logger"] } toml = "0.5.8" diff --git a/src/mail.rs b/src/mail.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use askama::Template; use tide::Request; @@ -21,7 +20,7 @@ struct Email { } impl Email { - fn from_parsed(mail: &ParsedMail) -> Result<Self> { + fn from_parsed(mail: &ParsedMail) -> tide::Result<Self> { Ok(Email { subject: mail.headers.get_first_value("Subject").unwrap(), }) diff --git a/src/main.rs b/src/main.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use askama::Template; use git2::{Commit, Diff, Reference, Repository, Tree}; use once_cell::sync::Lazy;