mirror of
https://github.com/ultraworkers/claw-code-parity.git
synced 2026-04-30 08:37:48 +02:00
fix(cli): use map_or_else when loading managed sessions
Resolves clippy::map_unwrap_or in main.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:
@@ -2058,7 +2058,17 @@ fn list_managed_sessions() -> Result<Vec<ManagedSessionSummary>, Box<dyn std::er
|
||||
.map(|duration| duration.as_secs())
|
||||
.unwrap_or_default();
|
||||
let (id, message_count, parent_session_id, branch_name) = Session::load_from_path(&path)
|
||||
.map(|session| {
|
||||
.map_or_else(|_| {
|
||||
(
|
||||
path.file_stem()
|
||||
.and_then(|value| value.to_str())
|
||||
.unwrap_or("unknown")
|
||||
.to_string(),
|
||||
0,
|
||||
None,
|
||||
None,
|
||||
)
|
||||
}, |session| {
|
||||
let parent_session_id = session
|
||||
.fork
|
||||
.as_ref()
|
||||
@@ -2073,17 +2083,6 @@ fn list_managed_sessions() -> Result<Vec<ManagedSessionSummary>, Box<dyn std::er
|
||||
parent_session_id,
|
||||
branch_name,
|
||||
)
|
||||
})
|
||||
.unwrap_or_else(|_| {
|
||||
(
|
||||
path.file_stem()
|
||||
.and_then(|value| value.to_str())
|
||||
.unwrap_or("unknown")
|
||||
.to_string(),
|
||||
0,
|
||||
None,
|
||||
None,
|
||||
)
|
||||
});
|
||||
sessions.push(ManagedSessionSummary {
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user