update dependencies
This commit is contained in:
parent
cac483b99f
commit
fa2698eaa4
4 changed files with 1341 additions and 1020 deletions
2437
Cargo.lock
generated
2437
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
13
Cargo.toml
13
Cargo.toml
|
|
@ -9,17 +9,16 @@ edition = "2021"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rand = "0.8.4"
|
rand ="0.10.1"
|
||||||
rocket = "0.5.0-rc.1"
|
rocket = "0.5.1"
|
||||||
tree_magic = "0.2.3"
|
tree_magic = "0.2.3"
|
||||||
syntect = "4.6.0"
|
syntect = "5.3.0"
|
||||||
rust-embed="6.3.0"
|
rust-embed="8.11.0"
|
||||||
clap = { version = "3.0.9", features = ["derive", "env"] }
|
clap = { version = "4.6.1", features = ["derive", "env"] }
|
||||||
once_cell = "1"
|
once_cell = "1"
|
||||||
sha256 = "1"
|
sha256 = "1"
|
||||||
time = { version = "0.3", features = ["formatting"] }
|
time = { version = "0.3", features = ["formatting"] }
|
||||||
|
|
||||||
[dependencies.rocket_dyn_templates]
|
[dependencies.rocket_dyn_templates]
|
||||||
version = "0.1.0-rc.1"
|
version = "0.2.0"
|
||||||
features = ["tera"]
|
features = ["tera"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use std::fmt;
|
||||||
|
|
||||||
use rocket::request::FromParam;
|
use rocket::request::FromParam;
|
||||||
|
|
||||||
use rand::{self, distributions::Alphanumeric, Rng};
|
use rand::{self, distr::Alphanumeric, RngExt};
|
||||||
|
|
||||||
pub struct PasteId<'a>(Cow<'a, str>);
|
pub struct PasteId<'a>(Cow<'a, str>);
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@ fn valid_id(id: &str) -> bool {
|
||||||
|
|
||||||
impl<'a> PasteId<'a> {
|
impl<'a> PasteId<'a> {
|
||||||
pub fn new(size: usize) -> PasteId<'static> {
|
pub fn new(size: usize) -> PasteId<'static> {
|
||||||
let id: String = rand::thread_rng()
|
let id: String = rand::rng()
|
||||||
.sample_iter(&Alphanumeric)
|
.sample_iter(&Alphanumeric)
|
||||||
.take(size)
|
.take(size)
|
||||||
.map(char::from)
|
.map(char::from)
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,6 @@ pub fn get_pretty_body(path: &Path, ext: &str) -> std::io::Result<String> {
|
||||||
.find_syntax_by_token(ext)
|
.find_syntax_by_token(ext)
|
||||||
.unwrap_or_else(|| ss.find_syntax_plain_text());
|
.unwrap_or_else(|| ss.find_syntax_plain_text());
|
||||||
|
|
||||||
Ok(highlighted_html_for_string(&content, &ss, syntax, &theme))
|
highlighted_html_for_string(&content, &ss, syntax, &theme)
|
||||||
|
.map_err(std::io::Error::other)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue