aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-17 22:08:16 -0700
committerFuwn <[email protected]>2022-04-17 22:08:16 -0700
commit11c9a673dff462d47a7a83b5378d0611b154c86f (patch)
treeb11bb67f237b8c92e73d429a9fcd17eac6162455
parentrefactor: decrease cache rate (diff)
downloadlocus-11c9a673dff462d47a7a83b5378d0611b154c86f.tar.xz
locus-11c9a673dff462d47a7a83b5378d0611b154c86f.zip
build(rustc): bump toolchain
-rw-r--r--.github/workflows/check.yaml2
-rw-r--r--rust-toolchain.toml2
-rw-r--r--src/macros.rs12
-rw-r--r--src/route.rs2
4 files changed, 9 insertions, 9 deletions
diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml
index 47f63a3..f870ded 100644
--- a/.github/workflows/check.yaml
+++ b/.github/workflows/check.yaml
@@ -23,7 +23,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
- toolchain: nightly-2022-02-22
+ toolchain: nightly-2022-04-16
components: rustfmt, clippy
override: true
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 22a9829..8905c53 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,2 +1,2 @@
[toolchain]
-channel = "nightly-2022-02-22"
+channel = "nightly-2022-04-16"
diff --git a/src/macros.rs b/src/macros.rs
index 7d3868c..f0e805f 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -22,7 +22,7 @@ macro_rules! success {
Response::Success(
Main {
body: &$body,
- hits: &crate::route::hits_from($context.url.path()),
+ hits: &$crate::route::hits_from($context.url.path()),
quote: {
use rand::seq::SliceRandom;
@@ -43,15 +43,15 @@ macro_rules! success {
#[macro_export]
macro_rules! mount_page {
($router:ident, $at:literal, $description:literal, $file:literal) => {
- (*crate::ROUTES.lock().unwrap())
- .insert($at.to_string(), crate::route::Route::new($description));
+ (*$crate::ROUTES.lock().unwrap())
+ .insert($at.to_string(), $crate::route::Route::new($description));
($router).mount(
$at,
Box::new(|context| {
let content = include_str!(concat!("../content/pages/", $file, ".gmi"));
- crate::route::cache(&context, &content);
+ $crate::route::cache(&context, &content);
success!(content, context)
}),
);
@@ -61,8 +61,8 @@ macro_rules! mount_page {
#[macro_export]
macro_rules! mount_file {
($router:ident, $at:literal, $description:literal, $file:literal) => {
- (*crate::ROUTES.lock().unwrap())
- .insert($at.to_string(), crate::route::Route::new($description));
+ (*$crate::ROUTES.lock().unwrap())
+ .insert($at.to_string(), $crate::route::Route::new($description));
($router).mount(
$at,
diff --git a/src/route.rs b/src/route.rs
index 251370c..7dfa5e7 100644
--- a/src/route.rs
+++ b/src/route.rs
@@ -65,7 +65,7 @@ pub fn cache(context: &windmark::returnable::RouteContext<'_>, response: &str) {
>= std::time::Duration::from_secs(crate::CACHE_RATE)
|| (*ROUTES.lock().unwrap())
.get(context.url.path())
- .is_some_with(|&r| r.text_cache.is_empty())
+ .is_some_and(|&r| r.text_cache.is_empty())
{
(*LAST_CACHED.lock().unwrap()) = Instant::now();