Skip to content

Commit

Permalink
use serde_variant again
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Apr 6, 2024
1 parent 481fb6f commit 79b24cc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 33 deletions.
41 changes: 11 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions butane_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ uuid = ["butane_core/uuid"]
butane_core = { workspace = true }
proc-macro2 = { workspace = true }
quote = { workspace = true }
serde_variant = "0.1.3"
syn = { workspace = true }

[lib]
Expand Down
2 changes: 1 addition & 1 deletion butane_codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ pub fn derive_field_type(input: TokenStream) -> TokenStream {
}

fn derive_field_type_for_newtype(ident: &Ident, sqltype: SqlType) -> TokenStream {
let sqltype_name: &'static str = sqltype.clone().into();
let sqltype_name = serde_variant::to_variant_name(&sqltype).unwrap();
let sqltype_ident = syn::Ident::new(sqltype_name, proc_macro2::Span::call_site());

let mut migrations = migrations_for_dir();
Expand Down
1 change: 0 additions & 1 deletion butane_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ regex = { version = "1.5", features = ["std"] }
rusqlite = { workspace = true, optional = true }
serde = { features = ["derive"], workspace = true }
serde_json = { workspace = true }
strum = { version = "0.26", features = ["derive"] }
sqlparser = { workspace = true }
syn = { workspace = true }
thiserror = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion butane_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl From<rusqlite::types::FromSqlError> for Error {
/// Enumeration of the types a database value may take.
///
/// See also [`SqlVal`].
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, strum::IntoStaticStr)]
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub enum SqlType {
/// Boolean
Bool,
Expand Down

0 comments on commit 79b24cc

Please sign in to comment.