Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Support sea-orm
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Dec 25, 2021
1 parent 0c80602 commit 23853b6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 16 deletions.
19 changes: 12 additions & 7 deletions strum/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "strum"
name = "sea-strum"
version = "0.23.0"
edition = "2018"
authors = ["Peter Glotfelty <[email protected]>"]
Expand All @@ -9,24 +9,29 @@ description = "Helpful macros for working with enums and strings"
keywords = ["enum", "string", "macros", "proc-macros"]
categories = ["development-tools::procedural-macro-helpers", "parsing"]

documentation = "https://docs.rs/strum"
homepage = "https://github.com/Peternator7/strum"
repository = "https://github.com/Peternator7/strum"
documentation = "https://docs.rs/sea-strum"
homepage = "https://github.com/SeaQL/strum"
repository = "https://github.com/SeaQL/strum"
readme = "../README.md"

[lib]
name = "strum"
path = "src/lib.rs"

[dependencies]
strum_macros = { path = "../strum_macros", optional = true, version = "0.23" }
sea-strum_macros = { path = "../strum_macros", optional = true, version = "0.23" }

[dev-dependencies]
strum_macros = { path = "../strum_macros", version = "0.23" }
sea-strum_macros = { path = "../strum_macros", version = "0.23" }

[badges]
travis-ci = { repository = "Peternator7/strum" }

[features]
default = ["std"]
derive = ["strum_macros"]
derive = ["sea-strum_macros"]
std = []
sea-orm = ["sea-strum_macros/sea-orm"]

[package.metadata.docs.rs]
features = ["derive"]
Expand Down
11 changes: 7 additions & 4 deletions strum_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "strum_macros"
name = "sea-strum_macros"
version = "0.23.0"
edition = "2018"
authors = ["Peter Glotfelty <[email protected]>"]
Expand All @@ -9,9 +9,9 @@ description = "Helpful macros for working with enums and strings"
keywords = ["enum", "string", "macros", "proc-macros"]
categories = ["development-tools::procedural-macro-helpers", "parsing"]

documentation = "https://docs.rs/strum"
homepage = "https://github.com/Peternator7/strum"
repository = "https://github.com/Peternator7/strum"
documentation = "https://docs.rs/sea-strum"
homepage = "https://github.com/SeaQL/strum"
repository = "https://github.com/SeaQL/strum"
readme = "../README.md"

[lib]
Expand All @@ -27,3 +27,6 @@ syn = { version = "1.0", features = ["parsing", "extra-traits"] }

[dev-dependencies]
strum = "0.20"

[features]
sea-orm = []
9 changes: 8 additions & 1 deletion strum_macros/src/helpers/type_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ impl StrumTypeProperties {
if let Some(path) = &self.crate_module_path {
parse_quote!(#path)
} else {
parse_quote!(::strum)
#[cfg(feature = "sea-orm")]
{
parse_quote!(sea_orm::strum)
}
#[cfg(not(feature = "sea-orm"))]
{
parse_quote!(::strum)
}
}
}
}
4 changes: 2 additions & 2 deletions strum_nostd_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
strum = { path = "../strum", features = ["derive"] }
strum_macros = { path = "../strum_macros", features = [] }
sea-strum = { path = "../strum", features = ["derive"] }
sea-strum_macros = { path = "../strum_macros", features = [] }

[dev-dependencies]
rustversion = "1.0"
4 changes: 2 additions & 2 deletions strum_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ edition = "2018"
authors = ["Peter Glotfelty <[email protected]>"]

[dependencies]
strum = { path = "../strum", features = ["derive"] }
strum_macros = { path = "../strum_macros", features = [] }
sea-strum = { path = "../strum", features = ["derive"] }
sea-strum_macros = { path = "../strum_macros", features = [] }
clap = "2.33.0"
enum_variant_type = "=0.2.0"
structopt = "0.2.18"
Expand Down
Empty file modified travis.sh
100755 → 100644
Empty file.

0 comments on commit 23853b6

Please sign in to comment.