Update MSRV
Diff
Cargo.lock | 3 +--
Cargo.toml | 1 -
flake.lock | 48 ++++++++++++++++++++++++++++++++++++++++--------
flake.nix | 7 +++++--
src/errors.rs | 1 +
src/highlight.rs | 4 ++--
src/io.rs | 8 ++++----
src/main.rs | 4 ++--
8 files changed, 49 insertions(+), 27 deletions(-)
@@ -1,6 +1,6 @@
version = 3
version = 4
[[package]]
name = "actix"
@@ -489,7 +489,6 @@
"htmlescape",
"linked-hash-map",
"log",
"once_cell",
"parking_lot",
"pretty_env_logger",
"rand 0.8.5",
@@ -12,7 +12,6 @@
log = "0.4"
pretty_env_logger = "0.5"
linked-hash-map = "0.5"
once_cell = "1.19"
parking_lot = "0.12"
bytes = { version = "1.2", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
@@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1662220400,
"narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=",
"lastModified": 1745925850,
"narHash": "sha256-cyAAMal0aPrlb1NgzMxZqeN1mAJ2pJseDhm2m6Um8T0=",
"owner": "nix-community",
"repo": "naersk",
"rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3",
"rev": "38bc60bbc157ae266d4a0c96671c6c742ee17a5f",
"type": "github"
},
"original": {
@@ -21,25 +21,27 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1670118144,
"narHash": "sha256-tdh9H4oomljZaKpCkZox8jmwt8p78oGLpK9cjFBy3Qk=",
"lastModified": 1747958103,
"narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "95f1ec721652d91a2993311d6cf537d3724690be",
"rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1670118144,
"narHash": "sha256-tdh9H4oomljZaKpCkZox8jmwt8p78oGLpK9cjFBy3Qk=",
"lastModified": 1747958103,
"narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "95f1ec721652d91a2993311d6cf537d3724690be",
"rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1",
"type": "github"
},
"original": {
@@ -54,15 +56,33 @@
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@@ -12,9 +12,12 @@
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage ./.;
defaultPackage = naersk-lib.buildPackage {
src = ./.;
nativeBuildInputs = with pkgs; [ zlib ];
};
devShell = with pkgs; mkShell {
buildInputs = [ cargo rustc rustfmt pre-commit rustPackages.clippy ];
buildInputs = [ cargo rustc rustfmt pre-commit rustPackages.clippy zlib pkg-config ];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
@@ -30,6 +30,7 @@
impl_response_error_for_http_resp!(NotFound, "../templates/404.html", StatusCode::NOT_FOUND);
#[derive(Debug)]
#[allow(dead_code)]
pub struct InternalServerError(pub Box<dyn std::error::Error>);
impl_response_error_for_http_resp!(
@@ -1,5 +1,5 @@
use bat::assets::HighlightingAssets;
use once_cell::sync::Lazy;
use std::sync::LazyLock;
use syntect::{
html::{ClassStyle, ClassedHTMLGenerator},
parsing::SyntaxSet,
@@ -12,7 +12,7 @@
pub fn highlight(content: &str, ext: &str) -> Option<String> {
static SS: Lazy<SyntaxSet> = Lazy::new(SyntaxSet::load_defaults_newlines);
static SS: LazyLock<SyntaxSet> = LazyLock::new(SyntaxSet::load_defaults_newlines);
BAT_ASSETS
.with(|f| {
@@ -1,13 +1,13 @@
use actix_web::web::Bytes;
use linked_hash_map::LinkedHashMap;
use once_cell::sync::Lazy;
use parking_lot::RwLock;
use rand::{distributions::Alphanumeric, thread_rng, Rng};
use std::cell::RefCell;
use std::{cell::RefCell, sync::LazyLock};
pub type PasteStore = RwLock<LinkedHashMap<String, Bytes>>;
static BUFFER_SIZE: Lazy<usize> = Lazy::new(|| argh::from_env::<crate::BinArgs>().buffer_size);
static BUFFER_SIZE: LazyLock<usize> =
LazyLock::new(|| argh::from_env::<crate::BinArgs>().buffer_size);
@@ -50,5 +50,5 @@
pub fn get_paste(entries: &PasteStore, id: &str) -> Option<Bytes> {
entries.read().get(id).map(Bytes::clone)
entries.read().get(id).cloned()
}
@@ -20,10 +20,10 @@
};
use askama::{Html as AskamaHtml, MarkupDisplay, Template};
use log::{error, info};
use once_cell::sync::Lazy;
use std::{
borrow::Cow,
net::{IpAddr, Ipv4Addr, SocketAddr},
sync::LazyLock,
};
use syntect::html::{css_for_theme_with_class_style, ClassStyle};
@@ -168,7 +168,7 @@
}
async fn highlight_css() -> HttpResponse {
static CSS: Lazy<Bytes> = Lazy::new(|| {
static CSS: LazyLock<Bytes> = LazyLock::new(|| {
highlight::BAT_ASSETS.with(|s| {
Bytes::from(
css_for_theme_with_class_style(s.get_theme("OneHalfDark"), ClassStyle::Spaced)