diff options
| author | Mason Reed <mason@vector35.com> | 2025-11-03 20:14:49 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-11-04 13:34:46 -0500 |
| commit | 732c9abf47ee7bd23b3f330a8d20372dcb45a465 (patch) | |
| tree | 6da88e2129d82ea3f0e90e7030e83a00bb3a628a /plugins/warp/src | |
| parent | d926a195f4b6fa1ce8a45b9acc9232b17dfba7df (diff) | |
[WARP] Return existing source id when adding a file to a disk container
Removes the need to book keep on the caller side
Diffstat (limited to 'plugins/warp/src')
| -rw-r--r-- | plugins/warp/src/container/disk.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/warp/src/container/disk.rs b/plugins/warp/src/container/disk.rs index b0f48c29..a0400f9d 100644 --- a/plugins/warp/src/container/disk.rs +++ b/plugins/warp/src/container/disk.rs @@ -89,7 +89,11 @@ impl Container for DiskContainer { fn add_source(&mut self, path: SourcePath) -> ContainerResult<SourceId> { // Disk sources have there source id computed from the path. let source_id = path.to_source_id(); - self.insert_source(source_id, path)?; + match self.insert_source(source_id, path) { + Ok(()) => {} + Err(ContainerError::SourceAlreadyExists(_)) => {} + Err(err) => return Err(err), + } Ok(source_id) } |
