Format connected library Rust code
Some checks failed
Build / verify (push) Failing after 13m33s
Codex Template Compliance / template-compliance (push) Successful in 7s

This commit is contained in:
MrSphay
2026-05-03 23:35:03 +02:00
parent 376dd64fab
commit 150521094e
2 changed files with 13 additions and 10 deletions

View File

@@ -372,7 +372,10 @@ async fn fetch_manifest(url: &str) -> crate::Result<ConnectedManifest> {
Ok(manifest)
}
async fn fetch_mrpack(url: &str, expected_sha512: &str) -> crate::Result<bytes::Bytes> {
async fn fetch_mrpack(
url: &str,
expected_sha512: &str,
) -> crate::Result<bytes::Bytes> {
let parsed = Url::parse(url)?;
if parsed.scheme() != "https" {
return Err(ErrorKind::InputError(
@@ -384,11 +387,9 @@ async fn fetch_mrpack(url: &str, expected_sha512: &str) -> crate::Result<bytes::
let bytes = reqwest::get(url).await?.error_for_status()?.bytes().await?;
let hash = format!("{:x}", Sha512::digest(&bytes[..]));
if !hash.eq_ignore_ascii_case(expected_sha512) {
return Err(ErrorKind::HashError(
expected_sha512.to_string(),
hash,
)
.into());
return Err(
ErrorKind::HashError(expected_sha512.to_string(), hash).into()
);
}
Ok(bytes)
}
@@ -478,7 +479,10 @@ async fn upsert_manifest(
Ok(())
}
async fn get_by_id(pool: &SqlitePool, id: &str) -> crate::Result<ConnectedPack> {
async fn get_by_id(
pool: &SqlitePool,
id: &str,
) -> crate::Result<ConnectedPack> {
let row = sqlx::query(
"
SELECT id, source_url, manifest_url, name, version, version_id,

View File

@@ -32,11 +32,10 @@ pub mod data {
pub mod prelude {
pub use crate::{
State,
State, connected_library,
data::*,
event::CommandPayload,
connected_library, jre, metadata, minecraft_auth, mr_auth, pack,
process,
jre, metadata, minecraft_auth, mr_auth, pack, process,
profile::{self, Profile, create},
settings,
util::{