remove as_str() legacy wrappers, callers use .into() directly
This commit is contained in:
parent
299add158f
commit
46456f75ce
25 changed files with 46 additions and 128 deletions
|
|
@ -112,19 +112,6 @@ pub enum AgentState {
|
|||
Destroyed,
|
||||
}
|
||||
|
||||
impl AgentState {
|
||||
/// The wire spelling, for a reader that renders rather than decodes.
|
||||
///
|
||||
/// Derived (`#[strum(serialize_all = "snake_case")]`) from the same
|
||||
/// convention as the `serde(rename_all)` above, rather than a
|
||||
/// hand-written match kept in sync with it by hand; a test still pins
|
||||
/// the two together.
|
||||
#[must_use]
|
||||
pub fn as_str(self) -> &'static str {
|
||||
self.into()
|
||||
}
|
||||
}
|
||||
|
||||
/// Open the wanted-state bucket for writing, creating it if nothing has yet.
|
||||
///
|
||||
/// **Controller-side only.** `history: 1` because a hive converges to the
|
||||
|
|
@ -291,7 +278,7 @@ mod tests {
|
|||
}
|
||||
assert_eq!(
|
||||
serde_json::to_string(&state).expect("serialises"),
|
||||
format!("\"{}\"", state.as_str())
|
||||
format!("\"{}\"", <&str>::from(state))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue