🏗️ Elegant & Highly Performant Async Gemini Server Framework for the Modern Age
async framework gemini-protocol protocol gemini rust
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: drop rust nightly requirement!!!

Fuwn 398830dd afefaf95

+29 -53
+1 -1
Cargo.toml
··· 2 2 3 3 [package] 4 4 name = "windmark" 5 - version = "0.1.19" 5 + version = "0.1.20" 6 6 authors = ["Fuwn <contact@fuwn.me>"] 7 7 edition = "2021" 8 8 description = "An elegant and highly performant async Gemini server framework"
+6 -12
Makefile.toml
··· 1 - # ------------ 2 - # | Wrappers | 3 - # ------------ 4 1 [tasks.fmt] 2 + args = ["fmt"] 5 3 command = "cargo" 6 - args = ["fmt"] 7 - private = true 4 + toolchain = "nightly" 8 5 9 6 [tasks.check] 10 - command = "cargo" 11 7 args = ["check"] 12 - private = true 8 + command = "cargo" 9 + toolchain = "nightly" 13 10 14 11 [tasks.clippy] 12 + args = ["clippy"] 15 13 command = "cargo" 16 - args = ["clippy"] 17 - private = true 14 + toolchain = "nightly" 18 15 19 - # ------------- 20 - # | Executors | 21 - # ------------- 22 16 [tasks.checkf] 23 17 dependencies = ["fmt", "check"] 24 18
-6
README.md
··· 9 9 10 10 ## Usage 11 11 12 - ### Notice 13 - 14 - Windmark requires the nightly Rust toolchain! 15 - 16 - 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. 17 - 18 12 ### Add Windmark as a dependency 19 13 20 14 ```toml
+1 -1
rust-toolchain.toml
··· 1 1 [toolchain] 2 - channel = "nightly-2022-02-22" 2 + channel = "stable"
-1
src/lib.rs
··· 16 16 // Copyright (C) 2022-2022 Fuwn <contact@fuwn.me> 17 17 // SPDX-License-Identifier: GPL-3.0-only 18 18 19 - #![feature(once_cell, fn_traits)] 20 19 #![deny( 21 20 clippy::all, 22 21 clippy::nursery,
+21 -32
src/router.rs
··· 311 311 )); 312 312 } 313 313 314 - (*self.pre_route_callback).lock().unwrap().call_mut(( 315 - stream.get_ref(), 316 - &url, 317 - { 318 - if let Ok(route) = &route { 319 - Some(&route.params) 320 - } else { 321 - None 322 - } 323 - }, 324 - )); 314 + (*self.pre_route_callback).lock().unwrap()(stream.get_ref(), &url, { 315 + if let Ok(route) = &route { 316 + Some(&route.params) 317 + } else { 318 + None 319 + } 320 + }); 325 321 326 322 let content = if let Ok(ref route) = route { 327 323 let footers_length = (*self.footers.lock().unwrap()).len(); ··· 356 352 )); 357 353 } 358 354 to_value_set_status( 359 - (*route.value).lock().unwrap().call_mut((RouteContext::new( 355 + (*route.value).lock().unwrap()(RouteContext::new( 360 356 stream.get_ref(), 361 357 &url, 362 358 &route.params, 363 359 &stream.ssl().peer_certificate(), 364 - ),)), 360 + )), 365 361 &mut response_status, 366 362 &mut response_mime_type, 367 363 ) 368 364 } else { 369 365 to_value_set_status( 370 - (*self.error_handler) 371 - .lock() 372 - .unwrap() 373 - .call_mut((ErrorContext::new( 374 - stream.get_ref(), 375 - &url, 376 - &stream.ssl().peer_certificate(), 377 - ),)), 366 + (*self.error_handler).lock().unwrap()(ErrorContext::new( 367 + stream.get_ref(), 368 + &url, 369 + &stream.ssl().peer_certificate(), 370 + )), 378 371 &mut response_status, 379 372 &mut response_mime_type, 380 373 ) ··· 429 422 )); 430 423 } 431 424 432 - (*self.post_route_callback).lock().unwrap().call_mut(( 433 - stream.get_ref(), 434 - &url, 435 - { 436 - if let Ok(route) = &route { 437 - Some(&route.params) 438 - } else { 439 - None 440 - } 441 - }, 442 - )); 425 + (*self.post_route_callback).lock().unwrap()(stream.get_ref(), &url, { 426 + if let Ok(route) = &route { 427 + Some(&route.params) 428 + } else { 429 + None 430 + } 431 + }); 443 432 444 433 stream.shutdown().await?; 445 434