Update crates and optimize parameters

This commit is contained in:
spikecodes 2021-11-14 18:51:36 -08:00
parent 0f7ba3c61d
commit 34ea679519
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
6 changed files with 27 additions and 27 deletions

38
Cargo.lock generated
View file

@ -183,9 +183,9 @@ checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663"
[[package]]
name = "cc"
version = "1.0.71"
version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd"
checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
[[package]]
name = "cfg-if"
@ -613,13 +613,13 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.105"
version = "0.2.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013"
checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219"
[[package]]
name = "libreddit"
version = "0.16.0"
version = "0.17.0"
dependencies = [
"askama",
"async-recursion",
@ -797,9 +797,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]]
name = "proc-macro2"
version = "1.0.30"
version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70"
checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"
dependencies = [
"unicode-xid",
]
@ -992,9 +992,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.68"
version = "1.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
checksum = "e277c495ac6cd1a01a58d0a0c574568b4d1ddf14f59965c6a58b8d96400b54f3"
dependencies = [
"itoa",
"ryu",
@ -1116,9 +1116,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
version = "1.0.80"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966"
dependencies = [
"proc-macro2",
"quote",
@ -1180,9 +1180,9 @@ dependencies = [
[[package]]
name = "tinyvec"
version = "1.5.0"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7"
checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2"
dependencies = [
"tinyvec_macros",
]
@ -1195,9 +1195,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.12.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc"
checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee"
dependencies = [
"autocfg",
"bytes",
@ -1215,9 +1215,9 @@ dependencies = [
[[package]]
name = "tokio-macros"
version = "1.5.0"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2dd85aeaba7b68df939bd357c6afb36c87951be9e80bf9c859f2fc3e9fca0fd"
checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095"
dependencies = [
"proc-macro2",
"quote",
@ -1237,9 +1237,9 @@ dependencies = [
[[package]]
name = "tokio-util"
version = "0.6.8"
version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd"
checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0"
dependencies = [
"bytes",
"futures-core",

View file

@ -3,7 +3,7 @@ name = "libreddit"
description = " Alternative private front-end to Reddit"
license = "AGPL-3.0"
repository = "https://github.com/spikecodes/libreddit"
version = "0.16.0"
version = "0.17.0"
authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"]
edition = "2018"
@ -19,7 +19,7 @@ futures-lite = "1.12.0"
hyper = { version = "0.14.14", features = ["full"] }
hyper-rustls = "0.22.1"
route-recognizer = "0.3.1"
serde_json = "1.0.68"
tokio = { version = "1.12.0", features = ["full"] }
serde_json = "1.0.70"
tokio = { version = "1.13.0", features = ["full"] }
time = "0.2.7"
url = "2.2.2"

View file

@ -64,7 +64,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
sort,
prefs: Preferences::new(req),
single_thread,
url: url,
url,
})
}
// If the Reddit API returns an error, exit and send error page to user

View file

@ -39,7 +39,7 @@ pub async fn get(req: Request<Body>) -> Result<Response<Body>, String> {
let url = req.uri().to_string();
template(SettingsTemplate {
prefs: Preferences::new(req),
url: url,
url,
})
}

View file

@ -248,7 +248,7 @@ pub async fn wiki(req: Request<Body>) -> Result<Response<Body>, String> {
wiki: rewrite_urls(response["data"]["content_html"].as_str().unwrap_or("<h3>Wiki not found</h3>")),
page,
prefs: Preferences::new(req),
url: url,
url,
}),
Err(msg) => {
if msg == "quarantined" {
@ -286,7 +286,7 @@ pub async fn sidebar(req: Request<Body>) -> Result<Response<Body>, String> {
sub,
page: "Sidebar".to_string(),
prefs: Preferences::new(req),
url: url,
url,
}),
Err(msg) => {
if msg == "quarantined" {

View file

@ -611,7 +611,7 @@ pub async fn error(req: Request<Body>, msg: String) -> Result<Response<Body>, St
let body = ErrorTemplate {
msg,
prefs: Preferences::new(req),
url: url,
url,
}
.render()
.unwrap_or_default();