fix(runtime): use map_or_else for session id fallback
Resolves clippy::map_unwrap_or in session.rs. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
9cfbb8ceed
commit
ec5d3a546b
1 changed files with 1 additions and 2 deletions
|
|
@ -269,8 +269,7 @@ impl Session {
|
||||||
let session_id = object
|
let session_id = object
|
||||||
.get("session_id")
|
.get("session_id")
|
||||||
.and_then(JsonValue::as_str)
|
.and_then(JsonValue::as_str)
|
||||||
.map(ToOwned::to_owned)
|
.map_or_else(generate_session_id, ToOwned::to_owned);
|
||||||
.unwrap_or_else(generate_session_id);
|
|
||||||
let created_at_ms = object
|
let created_at_ms = object
|
||||||
.get("created_at_ms")
|
.get("created_at_ms")
|
||||||
.map(|value| required_u64_from_value(value, "created_at_ms"))
|
.map(|value| required_u64_from_value(value, "created_at_ms"))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue