Skip to content

Commit

Permalink
chore: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
philpax committed Apr 10, 2024
1 parent d051de0 commit 0a58847
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/custom_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,5 @@ fn genome_to_hex(genome: TextGenome) -> String {
}

fn hex_to_genome(hex: &str) -> TextGenome {
bytemuck::cast_slice::<u8, u16>(&hex::decode(hex).unwrap())
.into()
bytemuck::cast_slice::<u8, u16>(&hex::decode(hex).unwrap()).into()
}
17 changes: 11 additions & 6 deletions src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ impl Store {

pub fn get_interrogation(&self, key: i64) -> anyhow::Result<Option<Interrogation>> {
let db = &mut *self.0.lock();
let Some((
user_id, generation_id, guild_id, url, result, interrogator
)) = db.query_row(
let Some((user_id, generation_id, guild_id, url, result, interrogator)) = db
.query_row(
r"
SELECT
user_id, generation_id, guild_id, url, result, interrogator
Expand All @@ -178,7 +177,10 @@ impl Store {
[key],
|r| r.try_into(),
)
.optional()? else { return Ok(None); };
.optional()?
else {
return Ok(None);
};

Ok(Some(Interrogation::from_db(
user_id,
Expand Down Expand Up @@ -526,11 +528,14 @@ impl Store {
init_url,
image_url,
id,
guild_id
guild_id,
))
},
)
.optional()? else { return Ok(None); };
.optional()?
else {
return Ok(None);
};

Ok(Some(Generation {
id: Some(id),
Expand Down

0 comments on commit 0a58847

Please sign in to comment.