refactor: Use variables directly in formatted strings (#7284)

made with `cargo clippy --all --fix` then manually reviewed to ensure
this was the only thing that changed.
This commit is contained in:
Simon Laux
2025-10-09 17:26:59 +02:00
committed by GitHub
parent 00ae7ce33c
commit af58b86b60
23 changed files with 55 additions and 76 deletions

View File

@@ -68,7 +68,7 @@ impl ContactAddress {
pub fn new(s: &str) -> Result<Self> { pub fn new(s: &str) -> Result<Self> {
let addr = addr_normalize(s); let addr = addr_normalize(s);
if !may_be_valid_addr(&addr) { if !may_be_valid_addr(&addr) {
bail!("invalid address {:?}", s); bail!("invalid address {s:?}");
} }
Ok(Self(addr.to_string())) Ok(Self(addr.to_string()))
} }
@@ -257,16 +257,16 @@ impl EmailAddress {
.chars() .chars()
.any(|c| c.is_whitespace() || c == '<' || c == '>') .any(|c| c.is_whitespace() || c == '<' || c == '>')
{ {
bail!("Email {:?} must not contain whitespaces, '>' or '<'", input); bail!("Email {input:?} must not contain whitespaces, '>' or '<'");
} }
match &parts[..] { match &parts[..] {
[domain, local] => { [domain, local] => {
if local.is_empty() { if local.is_empty() {
bail!("empty string is not valid for local part in {:?}", input); bail!("empty string is not valid for local part in {input:?}");
} }
if domain.is_empty() { if domain.is_empty() {
bail!("missing domain after '@' in {:?}", input); bail!("missing domain after '@' in {input:?}");
} }
if domain.ends_with('.') { if domain.ends_with('.') {
bail!("Domain {domain:?} should not contain the dot in the end"); bail!("Domain {domain:?} should not contain the dot in the end");
@@ -276,7 +276,7 @@ impl EmailAddress {
domain: (*domain).to_string(), domain: (*domain).to_string(),
}) })
} }
_ => bail!("Email {:?} must contain '@' character", input), _ => bail!("Email {input:?} must contain '@' character"),
} }
} }
} }

View File

@@ -126,7 +126,7 @@ impl CommandApi {
.read() .read()
.await .await
.get_account(id) .get_account(id)
.ok_or_else(|| anyhow!("account with id {} not found", id))?; .ok_or_else(|| anyhow!("account with id {id} not found"))?;
Ok(sc) Ok(sc)
} }
@@ -308,8 +308,7 @@ impl CommandApi {
Ok(Account::from_context(&ctx, account_id).await?) Ok(Account::from_context(&ctx, account_id).await?)
} else { } else {
Err(anyhow!( Err(anyhow!(
"account with id {} doesn't exist anymore", "account with id {account_id} doesn't exist anymore"
account_id
)) ))
} }
} }
@@ -2312,8 +2311,7 @@ impl CommandApi {
let message = Message::load_from_db(&ctx, MsgId::new(msg_id)).await?; let message = Message::load_from_db(&ctx, MsgId::new(msg_id)).await?;
ensure!( ensure!(
message.get_viewtype() == Viewtype::Sticker, message.get_viewtype() == Viewtype::Sticker,
"message {} is not a sticker", "message {msg_id} is not a sticker"
msg_id
); );
let account_folder = ctx let account_folder = ctx
.get_dbfile() .get_dbfile()
@@ -2533,10 +2531,7 @@ impl CommandApi {
.to_u32(); .to_u32();
Ok(msg_id) Ok(msg_id)
} else { } else {
Err(anyhow!( Err(anyhow!("chat with id {chat_id} doesn't have draft message"))
"chat with id {} doesn't have draft message",
chat_id
))
} }
} }
} }

View File

@@ -418,7 +418,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
Ok(setup_code) => { Ok(setup_code) => {
println!("Setup code for the transferred setup message: {setup_code}",) println!("Setup code for the transferred setup message: {setup_code}",)
} }
Err(err) => bail!("Failed to generate setup code: {}", err), Err(err) => bail!("Failed to generate setup code: {err}"),
}, },
"get-setupcodebegin" => { "get-setupcodebegin" => {
ensure!(!arg1.is_empty(), "Argument <msg-id> missing."); ensure!(!arg1.is_empty(), "Argument <msg-id> missing.");
@@ -432,7 +432,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
setupcodebegin.unwrap_or_default(), setupcodebegin.unwrap_or_default(),
); );
} else { } else {
bail!("{} is no setup message.", msg_id,); bail!("{msg_id} is no setup message.",);
} }
} }
"continue-key-transfer" => { "continue-key-transfer" => {
@@ -527,7 +527,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
println!("Report written to: {file:#?}"); println!("Report written to: {file:#?}");
} }
Err(err) => { Err(err) => {
bail!("Failed to get connectivity html: {}", err); bail!("Failed to get connectivity html: {err}");
} }
} }
} }
@@ -1287,7 +1287,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
); );
} }
"" => (), "" => (),
_ => bail!("Unknown command: \"{}\" type ? for help.", arg0), _ => bail!("Unknown command: \"{arg0}\" type ? for help."),
} }
Ok(()) Ok(())

View File

@@ -466,7 +466,7 @@ async fn handle_cmd(
println!("QR code svg written to: {file:#?}"); println!("QR code svg written to: {file:#?}");
} }
Err(err) => { Err(err) => {
bail!("Failed to get QR code svg: {}", err); bail!("Failed to get QR code svg: {err}");
} }
} }
} }

View File

@@ -41,22 +41,22 @@ async fn main_impl() -> Result<()> {
if let Some(first_arg) = args.next() { if let Some(first_arg) = args.next() {
if first_arg.to_str() == Some("--version") { if first_arg.to_str() == Some("--version") {
if let Some(arg) = args.next() { if let Some(arg) = args.next() {
return Err(anyhow!("Unrecognized argument {:?}", arg)); return Err(anyhow!("Unrecognized argument {arg:?}"));
} }
eprintln!("{}", &*DC_VERSION_STR); eprintln!("{}", &*DC_VERSION_STR);
return Ok(()); return Ok(());
} else if first_arg.to_str() == Some("--openrpc") { } else if first_arg.to_str() == Some("--openrpc") {
if let Some(arg) = args.next() { if let Some(arg) = args.next() {
return Err(anyhow!("Unrecognized argument {:?}", arg)); return Err(anyhow!("Unrecognized argument {arg:?}"));
} }
println!("{}", CommandApi::openrpc_specification()?); println!("{}", CommandApi::openrpc_specification()?);
return Ok(()); return Ok(());
} else { } else {
return Err(anyhow!("Unrecognized option {:?}", first_arg)); return Err(anyhow!("Unrecognized option {first_arg:?}"));
} }
} }
if let Some(arg) = args.next() { if let Some(arg) = args.next() {
return Err(anyhow!("Unrecognized argument {:?}", arg)); return Err(anyhow!("Unrecognized argument {arg:?}"));
} }
// Install signal handlers early so that the shutdown is graceful starting from here. // Install signal handlers early so that the shutdown is graceful starting from here.

View File

@@ -78,7 +78,7 @@ impl Accounts {
ensure!(dir.exists(), "directory does not exist"); ensure!(dir.exists(), "directory does not exist");
let config_file = dir.join(CONFIG_NAME); let config_file = dir.join(CONFIG_NAME);
ensure!(config_file.exists(), "{:?} does not exist", config_file); ensure!(config_file.exists(), "{config_file:?} does not exist");
let config = Config::from_file(config_file, writable).await?; let config = Config::from_file(config_file, writable).await?;
let events = Events::new(); let events = Events::new();
@@ -724,8 +724,7 @@ impl Config {
{ {
ensure!( ensure!(
self.inner.accounts.iter().any(|e| e.id == id), self.inner.accounts.iter().any(|e| e.id == id),
"invalid account id: {}", "invalid account id: {id}"
id
); );
self.inner.selected_account = id; self.inner.selected_account = id;

View File

@@ -35,7 +35,7 @@ impl FromStr for EncryptPreference {
match s { match s {
"mutual" => Ok(EncryptPreference::Mutual), "mutual" => Ok(EncryptPreference::Mutual),
"nopreference" => Ok(EncryptPreference::NoPreference), "nopreference" => Ok(EncryptPreference::NoPreference),
_ => bail!("Cannot parse encryption preference {}", s), _ => bail!("Cannot parse encryption preference {s}"),
} }
} }
} }

View File

@@ -32,7 +32,7 @@ pub(crate) async fn handle_authres(
let from_domain = match EmailAddress::new(from) { let from_domain = match EmailAddress::new(from) {
Ok(email) => email.domain, Ok(email) => email.domain,
Err(e) => { Err(e) => {
return Err(anyhow::format_err!("invalid email {}: {:#}", from, e)); return Err(anyhow::format_err!("invalid email {from}: {e:#}"));
} }
}; };

View File

@@ -170,7 +170,7 @@ impl<'a> BlobObject<'a> {
false => name, false => name,
}; };
if !BlobObject::is_acceptible_blob_name(name) { if !BlobObject::is_acceptible_blob_name(name) {
return Err(format_err!("not an acceptable blob name: {}", name)); return Err(format_err!("not an acceptable blob name: {name}"));
} }
Ok(BlobObject { Ok(BlobObject {
blobdir: context.get_blobdir(), blobdir: context.get_blobdir(),
@@ -458,8 +458,7 @@ impl<'a> BlobObject<'a> {
{ {
if img_wh < 20 { if img_wh < 20 {
return Err(format_err!( return Err(format_err!(
"Failed to scale image to below {}B.", "Failed to scale image to below {max_bytes}B.",
max_bytes,
)); ));
} }

View File

@@ -96,7 +96,7 @@ impl CallInfo {
let duration = match minutes { let duration = match minutes {
0 => "<1 minute".to_string(), 0 => "<1 minute".to_string(),
1 => "1 minute".to_string(), 1 => "1 minute".to_string(),
n => format!("{} minutes", n), n => format!("{n} minutes"),
}; };
if self.is_incoming() { if self.is_incoming() {

View File

@@ -373,7 +373,7 @@ impl ChatId {
/// Returns true if the value was modified. /// Returns true if the value was modified.
pub(crate) async fn set_blocked(self, context: &Context, new_blocked: Blocked) -> Result<bool> { pub(crate) async fn set_blocked(self, context: &Context, new_blocked: Blocked) -> Result<bool> {
if self.is_special() { if self.is_special() {
bail!("ignoring setting of Block-status for {}", self); bail!("ignoring setting of Block-status for {self}");
} }
let count = context let count = context
.sql .sql
@@ -702,8 +702,7 @@ impl ChatId {
) -> Result<()> { ) -> Result<()> {
ensure!( ensure!(
!self.is_special(), !self.is_special(),
"bad chat_id, can not be special chat: {}", "bad chat_id, can not be special chat: {self}"
self
); );
context context
@@ -813,8 +812,7 @@ impl ChatId {
pub(crate) async fn delete_ex(self, context: &Context, sync: sync::Sync) -> Result<()> { pub(crate) async fn delete_ex(self, context: &Context, sync: sync::Sync) -> Result<()> {
ensure!( ensure!(
!self.is_special(), !self.is_special(),
"bad chat_id, can not be a special chat: {}", "bad chat_id, can not be a special chat: {self}"
self
); );
let chat = Chat::load_from_db(context, self).await?; let chat = Chat::load_from_db(context, self).await?;
@@ -3145,8 +3143,7 @@ pub async fn send_text_msg(
) -> Result<MsgId> { ) -> Result<MsgId> {
ensure!( ensure!(
!chat_id.is_special(), !chat_id.is_special(),
"bad chat_id, can not be a special chat: {}", "bad chat_id, can not be a special chat: {chat_id}"
chat_id
); );
let mut msg = Message::new_text(text_to_send); let mut msg = Message::new_text(text_to_send);
@@ -3914,13 +3911,11 @@ pub(crate) async fn add_contact_to_chat_ex(
let mut chat = Chat::load_from_db(context, chat_id).await?; let mut chat = Chat::load_from_db(context, chat_id).await?;
ensure!( ensure!(
chat.typ == Chattype::Group || chat.typ == Chattype::OutBroadcast, chat.typ == Chattype::Group || chat.typ == Chattype::OutBroadcast,
"{} is not a group/broadcast where one can add members", "{chat_id} is not a group/broadcast where one can add members"
chat_id
); );
ensure!( ensure!(
Contact::real_exists_by_id(context, contact_id).await? || contact_id == ContactId::SELF, Contact::real_exists_by_id(context, contact_id).await? || contact_id == ContactId::SELF,
"invalid contact_id {} for adding to group", "invalid contact_id {contact_id} for adding to group"
contact_id
); );
ensure!(!chat.is_mailing_list(), "Mailing lists can't be changed"); ensure!(!chat.is_mailing_list(), "Mailing lists can't be changed");
ensure!( ensure!(
@@ -4133,8 +4128,7 @@ pub async fn remove_contact_from_chat(
) -> Result<()> { ) -> Result<()> {
ensure!( ensure!(
!chat_id.is_special(), !chat_id.is_special(),
"bad chat_id, can not be special chat: {}", "bad chat_id, can not be special chat: {chat_id}"
chat_id
); );
ensure!( ensure!(
!contact_id.is_special() || contact_id == ContactId::SELF, !contact_id.is_special() || contact_id == ContactId::SELF,
@@ -4148,7 +4142,7 @@ pub async fn remove_contact_from_chat(
"Cannot remove contact {contact_id} from chat {chat_id}: self not in group." "Cannot remove contact {contact_id} from chat {chat_id}: self not in group."
); );
context.emit_event(EventType::ErrorSelfNotInGroup(err_msg.clone())); context.emit_event(EventType::ErrorSelfNotInGroup(err_msg.clone()));
bail!("{}", err_msg); bail!("{err_msg}");
} else { } else {
let mut sync = Nosync; let mut sync = Nosync;
@@ -4390,7 +4384,7 @@ pub async fn forward_msgs(context: &Context, msg_ids: &[MsgId], chat_id: ChatId)
.await?; .await?;
let mut chat = Chat::load_from_db(context, chat_id).await?; let mut chat = Chat::load_from_db(context, chat_id).await?;
if let Some(reason) = chat.why_cant_send(context).await? { if let Some(reason) = chat.why_cant_send(context).await? {
bail!("cannot send to {}: {}", chat_id, reason); bail!("cannot send to {chat_id}: {reason}");
} }
curr_timestamp = create_smeared_timestamps(context, msg_ids.len()); curr_timestamp = create_smeared_timestamps(context, msg_ids.len());
let mut msgs = Vec::with_capacity(msg_ids.len()); let mut msgs = Vec::with_capacity(msg_ids.len());

View File

@@ -1742,8 +1742,7 @@ pub(crate) async fn set_blocked(
) -> Result<()> { ) -> Result<()> {
ensure!( ensure!(
!contact_id.is_special(), !contact_id.is_special(),
"Can't block special contact {}", "Can't block special contact {contact_id}"
contact_id
); );
let contact = Contact::get_by_id(context, contact_id).await?; let contact = Contact::get_by_id(context, contact_id).await?;

View File

@@ -500,7 +500,7 @@ impl std::str::FromStr for Fingerprint {
.filter(|&c| c.is_ascii_hexdigit()) .filter(|&c| c.is_ascii_hexdigit())
.collect(); .collect();
let v: Vec<u8> = hex::decode(&hex_repr)?; let v: Vec<u8> = hex::decode(&hex_repr)?;
ensure!(v.len() == 20, "wrong fingerprint length: {}", hex_repr); ensure!(v.len() == 20, "wrong fingerprint length: {hex_repr}");
let fp = Fingerprint::new(v); let fp = Fingerprint::new(v);
Ok(fp) Ok(fp)
} }

View File

@@ -490,8 +490,7 @@ impl Message {
pub async fn load_from_db_optional(context: &Context, id: MsgId) -> Result<Option<Message>> { pub async fn load_from_db_optional(context: &Context, id: MsgId) -> Result<Option<Message>> {
ensure!( ensure!(
!id.is_special(), !id.is_special(),
"Can not load special message ID {} from DB", "Can not load special message ID {id} from DB"
id
); );
let msg = context let msg = context
.sql .sql

View File

@@ -419,10 +419,7 @@ impl MimeFactory {
None None
} else { } else {
if keys.is_empty() && !recipients.is_empty() { if keys.is_empty() && !recipients.is_empty() {
bail!( bail!("No recipient keys are available, cannot encrypt to {recipients:?}.");
"No recipient keys are available, cannot encrypt to {:?}.",
recipients
);
} }
// Remove recipients for which the key is missing. // Remove recipients for which the key is missing.

View File

@@ -2080,7 +2080,7 @@ pub(crate) fn parse_message_id(ids: &str) -> Result<String> {
if let Some(id) = parse_message_ids(ids).first() { if let Some(id) = parse_message_ids(ids).first() {
Ok(id.to_string()) Ok(id.to_string())
} else { } else {
bail!("could not parse message_id: {}", ids); bail!("could not parse message_id: {ids}");
} }
} }

View File

@@ -284,7 +284,7 @@ impl str::FromStr for Params {
inner.insert(key, value); inner.insert(key, value);
} }
} else { } else {
bail!("Not a key-value pair: {:?}", line); bail!("Not a key-value pair: {line:?}");
} }
} }

View File

@@ -408,7 +408,7 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Result<Qr> {
let encoded_name = encoded_name.replace('+', "%20"); // sometimes spaces are encoded as `+` let encoded_name = encoded_name.replace('+', "%20"); // sometimes spaces are encoded as `+`
match percent_decode_str(&encoded_name).decode_utf8() { match percent_decode_str(&encoded_name).decode_utf8() {
Ok(name) => name.to_string(), Ok(name) => name.to_string(),
Err(err) => bail!("Invalid name: {}", err), Err(err) => bail!("Invalid name: {err}"),
} }
} else { } else {
"".to_string() "".to_string()
@@ -432,7 +432,7 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Result<Qr> {
let encoded_name = encoded_name.replace('+', "%20"); // sometimes spaces are encoded as `+` let encoded_name = encoded_name.replace('+', "%20"); // sometimes spaces are encoded as `+`
match percent_decode_str(&encoded_name).decode_utf8() { match percent_decode_str(&encoded_name).decode_utf8() {
Ok(name) => Some(name.to_string()), Ok(name) => Some(name.to_string()),
Err(err) => bail!("Invalid group name: {}", err), Err(err) => bail!("Invalid group name: {err}"),
} }
} else { } else {
None None
@@ -581,7 +581,7 @@ fn decode_tg_socks_proxy(_context: &Context, qr: &str) -> Result<Qr> {
} }
let Some(host) = host else { let Some(host) = host else {
bail!("Bad t.me/socks url: {:?}", url); bail!("Bad t.me/socks url: {url:?}");
}; };
let mut url = "socks5://".to_string(); let mut url = "socks5://".to_string();
@@ -684,10 +684,7 @@ pub(crate) async fn set_account_from_qr(context: &Context, qr: &str) -> Result<(
context.emit_event(EventType::Error(format!( context.emit_event(EventType::Error(format!(
"Cannot create account, server response could not be parsed:\n{parse_error:#}\nraw response:\n{response_text}" "Cannot create account, server response could not be parsed:\n{parse_error:#}\nraw response:\n{response_text}"
))); )));
bail!( bail!("Cannot create account, unexpected server response:\n{response_text:?}")
"Cannot create account, unexpected server response:\n{:?}",
response_text
)
} }
} }
} }

View File

@@ -122,7 +122,7 @@ pub(super) fn decode_login(qr: &str) -> Result<Qr> {
options, options,
}) })
} else { } else {
bail!("Bad scheme for account URL: {:?}.", payload); bail!("Bad scheme for account URL: {payload:?}.");
} }
} }
@@ -139,7 +139,7 @@ fn parse_socket_security(security: Option<&String>) -> Result<Option<Socket>> {
Some("starttls") => Some(Socket::Starttls), Some("starttls") => Some(Socket::Starttls),
Some("default") => Some(Socket::Automatic), Some("default") => Some(Socket::Automatic),
Some("plain") => Some(Socket::Plain), Some("plain") => Some(Socket::Plain),
Some(other) => bail!("Unknown security level: {}", other), Some(other) => bail!("Unknown security level: {other}"),
None => None, None => None,
}) })
} }
@@ -152,7 +152,7 @@ fn parse_certificate_checks(
Some("1") => Some(EnteredCertificateChecks::Strict), Some("1") => Some(EnteredCertificateChecks::Strict),
Some("2") => Some(EnteredCertificateChecks::AcceptInvalidCertificates), Some("2") => Some(EnteredCertificateChecks::AcceptInvalidCertificates),
Some("3") => Some(EnteredCertificateChecks::AcceptInvalidCertificates2), Some("3") => Some(EnteredCertificateChecks::AcceptInvalidCertificates2),
Some(other) => bail!("Unknown certificatecheck level: {}", other), Some(other) => bail!("Unknown certificatecheck level: {other}"),
None => None, None => None,
}) })
} }

View File

@@ -932,7 +932,7 @@ impl Scheduler {
// wait for all loops to be started // wait for all loops to be started
if let Err(err) = try_join_all(start_recvs).await { if let Err(err) = try_join_all(start_recvs).await {
bail!("failed to start scheduler: {}", err); bail!("failed to start scheduler: {err}");
} }
info!(ctx, "scheduler is running"); info!(ctx, "scheduler is running");

View File

@@ -242,7 +242,7 @@ pub(crate) async fn smtp_send(
// Yandex error "554 5.7.1 [2] Message rejected under suspicion of SPAM; https://ya.cc/..." // Yandex error "554 5.7.1 [2] Message rejected under suspicion of SPAM; https://ya.cc/..."
// should definitely go here, because user has to open the link to // should definitely go here, because user has to open the link to
// resume message sending. // resume message sending.
SendResult::Failure(format_err!("Permanent SMTP error: {}", err)) SendResult::Failure(format_err!("Permanent SMTP error: {err}"))
} }
} }
async_smtp::error::Error::Transient(ref response) => { async_smtp::error::Error::Transient(ref response) => {
@@ -471,7 +471,7 @@ pub(crate) async fn send_msg_to_smtp(
} }
Ok(()) Ok(())
} }
SendResult::Failure(err) => Err(format_err!("{}", err)), SendResult::Failure(err) => Err(format_err!("{err}")),
} }
} }
@@ -586,7 +586,7 @@ async fn send_mdn_rfc724_mid(
let addr = contact.get_addr(); let addr = contact.get_addr();
let recipient = async_smtp::EmailAddress::new(addr.to_string()) let recipient = async_smtp::EmailAddress::new(addr.to_string())
.map_err(|err| format_err!("invalid recipient: {} {:?}", addr, err))?; .map_err(|err| format_err!("invalid recipient: {addr} {err:?}"))?;
let recipients = vec![recipient]; let recipients = vec![recipient];
match smtp_send(context, &recipients, &body, smtp, None).await { match smtp_send(context, &recipients, &body, smtp, None).await {

View File

@@ -69,7 +69,7 @@ pub(crate) async fn connect_and_auth(
.await .await
.context("SMTP failed to get OAUTH2 access token")?; .context("SMTP failed to get OAUTH2 access token")?;
if access_token.is_none() { if access_token.is_none() {
bail!("SMTP OAuth 2 error {}", addr); bail!("SMTP OAuth 2 error {addr}");
} }
( (
async_smtp::authentication::Credentials::new( async_smtp::authentication::Credentials::new(

View File

@@ -279,7 +279,7 @@ impl Context {
}; };
if !valid { if !valid {
bail!("{} is not a valid webxdc file", filename); bail!("{filename} is not a valid webxdc file");
} }
Ok(()) Ok(())
@@ -837,8 +837,8 @@ fn parse_webxdc_manifest(bytes: &[u8]) -> Result<WebxdcManifest> {
} }
async fn get_blob(archive: &mut SeekZipFileReader<BufReader<File>>, name: &str) -> Result<Vec<u8>> { async fn get_blob(archive: &mut SeekZipFileReader<BufReader<File>>, name: &str) -> Result<Vec<u8>> {
let (i, _) = find_zip_entry(archive.file(), name) let (i, _) =
.ok_or_else(|| anyhow!("no entry found for {}", name))?; find_zip_entry(archive.file(), name).ok_or_else(|| anyhow!("no entry found for {name}"))?;
let mut reader = archive.reader_with_entry(i).await?; let mut reader = archive.reader_with_entry(i).await?;
let mut buf = Vec::new(); let mut buf = Vec::new();
reader.read_to_end_checked(&mut buf).await?; reader.read_to_end_checked(&mut buf).await?;