Skip to content

Commit 5c2c1e0

Browse files
committed
feat: [#1495] add len and is_empty methods to Swarms type
1 parent 31f1fbf commit 5c2c1e0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/torrent-repository/src/swarms.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,16 @@ impl Swarms {
294294

295295
Ok(metrics)
296296
}
297+
298+
#[must_use]
299+
pub fn len(&self) -> usize {
300+
self.swarms.len()
301+
}
302+
303+
#[must_use]
304+
pub fn is_empty(&self) -> bool {
305+
self.swarms.is_empty()
306+
}
297307
}
298308

299309
#[derive(thiserror::Error, Debug, Clone)]

0 commit comments

Comments
 (0)