change 'delete' to 'remove' everywhere to be consistent (#2834)

This commit is contained in:
Aiden McClelland
2025-02-20 17:14:04 -07:00
committed by GitHub
parent d63341ea06
commit 40d194672b
8 changed files with 26 additions and 25 deletions

View File

@@ -150,7 +150,6 @@ pub fn main(args: impl IntoIterator<Item = OsString>) {
.build()
.expect("failed to initialize runtime");
rt.block_on(async {
let addrs = crate::net::utils::all_socket_addrs_for(80).await?;
let mut server = WebServer::new(Acceptor::bind_upgradable(
SelfContainedNetworkInterfaceListener::bind(80),
));

View File

@@ -187,7 +187,7 @@ pub fn acme<C: Context>() -> ParentHandler<C> {
from_fn_async(remove)
.with_metadata("sync_db", Value::Bool(true))
.no_display()
.with_about("Setup ACME certificate acquisition")
.with_about("Remove ACME certificate acquisition configuration")
.with_call_remote::<CliContext>(),
)
}

View File

@@ -265,7 +265,9 @@ impl<A: Accept + Send + Sync + 'static> WebServer<A> {
drop(queue_cell.write().unwrap().take());
if !runner.is_empty() {
runner.await;
tokio::time::timeout(Duration::from_secs(60), runner)
.await
.ok();
}
}));
Self {

View File

@@ -54,8 +54,8 @@ pub fn wifi<C: Context>() -> ParentHandler<C> {
.with_call_remote::<CliContext>(),
)
.subcommand(
"delete",
from_fn_async(delete)
"remove",
from_fn_async(remove)
.no_display()
.with_about("Remove a wifi network")
.with_call_remote::<CliContext>(),
@@ -230,7 +230,7 @@ pub async fn connect(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result
}
#[instrument(skip_all)]
pub async fn delete(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result<(), Error> {
pub async fn remove(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result<(), Error> {
let wifi_manager = wifi_manager(&ctx)?;
if !ssid.is_ascii() {
return Err(Error::new(

View File

@@ -30,15 +30,15 @@ pub fn notification<C: Context>() -> ParentHandler<C> {
.with_call_remote::<CliContext>(),
)
.subcommand(
"delete",
from_fn_async(delete)
"remove",
from_fn_async(remove)
.no_display()
.with_about("Delete notification for a given id")
.with_call_remote::<CliContext>(),
)
.subcommand(
"delete-before",
from_fn_async(delete_before)
"remove-before",
from_fn_async(remove_before)
.no_display()
.with_about("Delete notifications preceding a given id")
.with_call_remote::<CliContext>(),
@@ -126,7 +126,7 @@ pub struct DeleteParams {
id: u32,
}
pub async fn delete(ctx: RpcContext, DeleteParams { id }: DeleteParams) -> Result<(), Error> {
pub async fn remove(ctx: RpcContext, DeleteParams { id }: DeleteParams) -> Result<(), Error> {
ctx.db
.mutate(|db| {
db.as_private_mut().as_notifications_mut().remove(&id)?;
@@ -142,7 +142,7 @@ pub struct DeleteBeforeParams {
before: u32,
}
pub async fn delete_before(
pub async fn remove_before(
ctx: RpcContext,
DeleteBeforeParams { before }: DeleteBeforeParams,
) -> Result<(), Error> {

View File

@@ -99,8 +99,8 @@ pub fn ssh<C: Context>() -> ParentHandler<C> {
.with_call_remote::<CliContext>(),
)
.subcommand(
"delete",
from_fn_async(delete)
"remove",
from_fn_async(remove)
.no_display()
.with_about("Remove ssh key")
.with_call_remote::<CliContext>(),
@@ -159,7 +159,7 @@ pub struct DeleteParams {
}
#[instrument(skip_all)]
pub async fn delete(
pub async fn remove(
ctx: RpcContext,
DeleteParams { fingerprint }: DeleteParams,
) -> Result<(), Error> {