diff options
| author | aur-build <aur-build@localhost> | 2026-11-23 14:14:42 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-23 14:14:42 +0000 |
| commit | f67249b1705e0075b11b50dac50fd71ae5e163d9 (patch) | |
| tree | 9156e927c68461cd930398e709ee6ea704721bc0 /src/db | |
| parent | 6872e81644546a9ccd0e1420c3ef64a26358f78a (diff) | |
| download | aur-build-f67249b1705e0075b11b50dac50fd71ae5e163d9.tar.gz aur-build-f67249b1705e0075b11b50dac50fd71ae5e163d9.zip | |
release build,readme: the gate that only the release build can seeai/main
`--all-targets` pulls `test-support` in through the dev-dependency, so
every check so far compiled `ReleaseState`, `Writer` and `json_or` as
`pub`. Without that feature they are crate-internal, and the tree was
not clean there: a wildcard import had been expanded into names the
release build never compiles, and `ReleaseState::as_str` took a
reference to a one-byte Copy value that clippy only complains about
once the type is not exported.
Both imports are gated with the code that needs them, and the README
now lists the three commands that hold the shape — including the
release-mode clippy run that found this.
Diffstat (limited to 'src/db')
| -rw-r--r-- | src/db/model/state.rs | 2 | ||||
| -rw-r--r-- | src/db/settings.rs | 4 | ||||
| -rw-r--r-- | src/db/world.rs | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/db/model/state.rs b/src/db/model/state.rs index 0eb9b6e..f3a3574 100644 --- a/src/db/model/state.rs +++ b/src/db/model/state.rs @@ -92,7 +92,7 @@ impl ReleaseState { const ALL: &'static [ReleaseState] = &[ReleaseState::Published, ReleaseState::Withdrawn, ReleaseState::FailedUnbuilt]; - pub fn as_str(&self) -> &'static str { + pub fn as_str(self) -> &'static str { match self { ReleaseState::Published => "published", ReleaseState::Withdrawn => "withdrawn", diff --git a/src/db/settings.rs b/src/db/settings.rs index 39190c8..452c4ff 100644 --- a/src/db/settings.rs +++ b/src/db/settings.rs @@ -1,6 +1,8 @@ use rusqlite::{params, OptionalExtension}; -use crate::db::{Db, Writer}; +use crate::db::Db; +#[cfg(feature = "test-support")] +use crate::db::Writer; use crate::error::Result; pub fn all_settings(db: &Db) -> Result<Vec<(String, String)>> { diff --git a/src/db/world.rs b/src/db/world.rs index 3a7bb9e..4bd832d 100644 --- a/src/db/world.rs +++ b/src/db/world.rs @@ -1,6 +1,8 @@ use rusqlite::params; -use crate::db::{json_or, Db, WorldMember, Writer}; +#[cfg(feature = "test-support")] +use crate::db::{json_or, Db}; +use crate::db::{WorldMember, Writer}; use crate::error::Result; use crate::time; |
