Update deps, structopt -> clap, re-enable cargo publish

This commit is contained in:
asonix
2022-09-28 18:01:52 -05:00
parent 061c1a0c0a
commit 5ae4c43caa
6 changed files with 463 additions and 579 deletions
+6 -6
View File
@@ -1,21 +1,21 @@
use structopt::StructOpt;
use clap::Parser;
#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
#[structopt(name = "relay", about = "An activitypub relay")]
pub(crate) struct Args {
#[structopt(short, help = "A list of domains that should be blocked")]
#[arg(short, help = "A list of domains that should be blocked")]
blocks: Vec<String>,
#[structopt(short, help = "A list of domains that should be allowed")]
#[arg(short, help = "A list of domains that should be allowed")]
allowed: Vec<String>,
#[structopt(short, long, help = "Undo allowing or blocking domains")]
#[arg(short, long, help = "Undo allowing or blocking domains")]
undo: bool,
}
impl Args {
pub(crate) fn new() -> Self {
Self::from_args()
Self::parse()
}
pub(crate) fn blocks(&self) -> &[String] {
+3 -1
View File
@@ -108,7 +108,9 @@ impl State {
let state = State {
public_key,
private_key,
object_cache: Arc::new(RwLock::new(LruCache::new(1024 * 8))),
object_cache: Arc::new(RwLock::new(LruCache::new(
(1024 * 8).try_into().expect("nonzero"),
))),
node_cache: NodeCache::new(db.clone()),
breakers: Breakers::default(),
db,