remove as_str() legacy wrappers, callers use .into() directly
This commit is contained in:
parent
299add158f
commit
46456f75ce
1 changed files with 46 additions and 128 deletions
|
|
@ -38,10 +38,6 @@ pub enum Wanted {
|
|||
}
|
||||
|
||||
impl Wanted {
|
||||
pub fn as_str(self) -> &'static str {
|
||||
self.into()
|
||||
}
|
||||
|
||||
/// Derived (`strum::EnumString`, the same `snake_case` convention
|
||||
/// `as_str` uses) rather than a hand-written match kept in sync with
|
||||
/// it by hand.
|
||||
|
|
@ -138,7 +134,7 @@ impl PowerStore {
|
|||
conn.execute(
|
||||
"INSERT INTO agent_power (agent, wanted, updated_at) VALUES (?1, ?2, ?3)
|
||||
ON CONFLICT(agent) DO UPDATE SET wanted = ?2, updated_at = ?3",
|
||||
params![agent, wanted.as_str(), Utc::now().timestamp()],
|
||||
params![agent, <&str>::from(wanted), Utc::now().timestamp()],
|
||||
)
|
||||
.context("upsert agent_power")?;
|
||||
Ok(())
|
||||
|
|
@ -154,7 +150,7 @@ impl PowerStore {
|
|||
}
|
||||
let seeded = Wanted::from_running(running);
|
||||
self.set(agent, seeded)?;
|
||||
tracing::info!(%agent, wanted = seeded.as_str(), "agent_power: seeded from observed state");
|
||||
tracing::info!(%agent, wanted = <&str>::from(seeded), "agent_power: seeded from observed state");
|
||||
Ok(seeded)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue