Skip to content

Instantly share code, notes, and snippets.

View HarrisonHemstreet's full-sized avatar
🏃‍♂️
hustle.

Harrison Hemstreet HarrisonHemstreet

🏃‍♂️
hustle.
View GitHub Profile
@HarrisonHemstreet
HarrisonHemstreet / bad_enum_read.rs
Created September 14, 2023 00:22
Rust, SQLx, PostgreSQL error when attempting to read a column of type enum
use serde::{Deserialize, Serialize};
#[derive(sqlx::Type, Serialize, Deserialize, Debug)]
#[sqlx(type_name = "status", rename_all = "lowercase")]
pub enum Status {
Active,
Inactive,
Suspended
}
@HarrisonHemstreet
HarrisonHemstreet / rust_quick_sort_kind_of
Created June 3, 2023 00:28
This is my homebrew quick sort. I don't think it's really quick sort, but it's close! :)
fn quick_sort_homebrew(mut vec1: Vec<i32>, pivot_index: usize) -> Vec<i32> {
println!("func ran");
let mut swap_position: usize = 0;
for num in &vec1 {
if num < &vec1[pivot_index] {
swap_position += 1;
}
}