aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-07-31 17:34:09 +0000
committerFuwn <[email protected]>2022-07-31 17:34:16 +0000
commitae81292908fd049365b9ff582727e0227af8563e (patch)
treefe376d5bc148a9691e1c57278c71ac383538d639
parentdocs(README.md): add nightly toolchain notice (diff)
downloadwindmark-0.1.20.tar.xz
windmark-0.1.20.zip
feat: drop rust nightly requirement!!!v0.1.20
-rw-r--r--Cargo.toml2
-rw-r--r--Makefile.toml18
-rw-r--r--README.md6
-rw-r--r--rust-toolchain.toml2
-rw-r--r--src/lib.rs1
-rw-r--r--src/router.rs53
6 files changed, 29 insertions, 53 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 45158de..88f0f96 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
[package]
name = "windmark"
-version = "0.1.19"
+version = "0.1.20"
authors = ["Fuwn <[email protected]>"]
edition = "2021"
description = "An elegant and highly performant async Gemini server framework"
diff --git a/Makefile.toml b/Makefile.toml
index ef78a0e..525424a 100644
--- a/Makefile.toml
+++ b/Makefile.toml
@@ -1,24 +1,18 @@
-# ------------
-# | Wrappers |
-# ------------
[tasks.fmt]
-command = "cargo"
args = ["fmt"]
-private = true
+command = "cargo"
+toolchain = "nightly"
[tasks.check]
-command = "cargo"
args = ["check"]
-private = true
+command = "cargo"
+toolchain = "nightly"
[tasks.clippy]
-command = "cargo"
args = ["clippy"]
-private = true
+command = "cargo"
+toolchain = "nightly"
-# -------------
-# | Executors |
-# -------------
[tasks.checkf]
dependencies = ["fmt", "check"]
diff --git a/README.md b/README.md
index 50bcdeb..4f0290a 100644
--- a/README.md
+++ b/README.md
@@ -9,12 +9,6 @@ the modern age!
## Usage
-### Notice
-
-Windmark requires the nightly Rust toolchain!
-
-To sync your project directory with Windmark's toolchain version, execute `rustup override set nightly-2022-02-22` within your command prompt while inside your projects directory.
-
### Add Windmark as a dependency
```toml
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 22a9829..292fe49 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,2 +1,2 @@
[toolchain]
-channel = "nightly-2022-02-22"
+channel = "stable"
diff --git a/src/lib.rs b/src/lib.rs
index 9e85d59..642182c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -16,7 +16,6 @@
// Copyright (C) 2022-2022 Fuwn <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only
-#![feature(once_cell, fn_traits)]
#![deny(
clippy::all,
clippy::nursery,
diff --git a/src/router.rs b/src/router.rs
index d4663f7..fdac351 100644
--- a/src/router.rs
+++ b/src/router.rs
@@ -311,17 +311,13 @@ impl Router {
));
}
- (*self.pre_route_callback).lock().unwrap().call_mut((
- stream.get_ref(),
- &url,
- {
- if let Ok(route) = &route {
- Some(&route.params)
- } else {
- None
- }
- },
- ));
+ (*self.pre_route_callback).lock().unwrap()(stream.get_ref(), &url, {
+ if let Ok(route) = &route {
+ Some(&route.params)
+ } else {
+ None
+ }
+ });
let content = if let Ok(ref route) = route {
let footers_length = (*self.footers.lock().unwrap()).len();
@@ -356,25 +352,22 @@ impl Router {
));
}
to_value_set_status(
- (*route.value).lock().unwrap().call_mut((RouteContext::new(
+ (*route.value).lock().unwrap()(RouteContext::new(
stream.get_ref(),
&url,
&route.params,
&stream.ssl().peer_certificate(),
- ),)),
+ )),
&mut response_status,
&mut response_mime_type,
)
} else {
to_value_set_status(
- (*self.error_handler)
- .lock()
- .unwrap()
- .call_mut((ErrorContext::new(
- stream.get_ref(),
- &url,
- &stream.ssl().peer_certificate(),
- ),)),
+ (*self.error_handler).lock().unwrap()(ErrorContext::new(
+ stream.get_ref(),
+ &url,
+ &stream.ssl().peer_certificate(),
+ )),
&mut response_status,
&mut response_mime_type,
)
@@ -429,17 +422,13 @@ impl Router {
));
}
- (*self.post_route_callback).lock().unwrap().call_mut((
- stream.get_ref(),
- &url,
- {
- if let Ok(route) = &route {
- Some(&route.params)
- } else {
- None
- }
- },
- ));
+ (*self.post_route_callback).lock().unwrap()(stream.get_ref(), &url, {
+ if let Ok(route) = &route {
+ Some(&route.params)
+ } else {
+ None
+ }
+ });
stream.shutdown().await?;