Skip to content

Commit 9819bff

Browse files
committed
fix: Clippy redundant_pattern_matching lint
1 parent c57d459 commit 9819bff

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

issue-61-comment.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The snapshot functionality has been implemented. This adds:
2+
3+
- `snapshot()` method to the SDK
4+
- `agentfs snapshot <ID_OR_PATH> <DEST_PATH>` CLI command
5+
6+
You can snapshot an active session's database by pointing to its delta.db file:
7+
8+
```
9+
agentfs snapshot ~/.agentfs/run/<session>/delta.db /path/to/snapshot.db
10+
```
11+
12+
The implementation uses WAL checkpoint + file copy. Note that there's a small race window between checkpoint and copy where concurrent writes from the FUSE process might not be captured. For fully consistent snapshots of an active mount, a future improvement could have the FUSE process handle the snapshot internally.

sdk/rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ impl AgentFS {
635635
// and truncates the WAL file
636636
let mut checkpoint_rows = conn.query("PRAGMA wal_checkpoint(TRUNCATE)", ()).await?;
637637
// Consume the result rows
638-
while let Some(_) = checkpoint_rows.next().await? {}
638+
while checkpoint_rows.next().await?.is_some() {}
639639

640640
// Get the source database path by querying the database filename
641641
let mut rows = conn.query("PRAGMA database_list", ()).await?;

0 commit comments

Comments
 (0)