From d243284e180d3d04e76817a998f11a079fec62ae Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 11 May 2023 12:48:57 -0700 Subject: [PATCH] Make `Pool` implement `Default`. (#317) A `Pool` can reasonably default to an empty set. --- cap-async-std/src/net/pool.rs | 2 +- cap-primitives/src/net/pool.rs | 2 +- cap-std/src/net/pool.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cap-async-std/src/net/pool.rs b/cap-async-std/src/net/pool.rs index 9c1fd61f..63051202 100644 --- a/cap-async-std/src/net/pool.rs +++ b/cap-async-std/src/net/pool.rs @@ -7,7 +7,7 @@ use cap_primitives::{ipnet, AmbientAuthority}; /// /// This does not directly correspond to anything in `async_std`, however its /// methods correspond to the several functions in [`async_std::net`]. -#[derive(Clone)] +#[derive(Clone, Default)] pub struct Pool { cap: cap_primitives::net::Pool, } diff --git a/cap-primitives/src/net/pool.rs b/cap-primitives/src/net/pool.rs index 219095fa..ecd0568f 100644 --- a/cap-primitives/src/net/pool.rs +++ b/cap-primitives/src/net/pool.rs @@ -54,7 +54,7 @@ impl IpGrant { /// /// This is presently a very simple concept, though it could grow in /// sophistication in the future. -#[derive(Clone)] +#[derive(Clone, Default)] pub struct Pool { // TODO: when compiling for WASI, use WASI-specific handle instead grants: Vec, diff --git a/cap-std/src/net/pool.rs b/cap-std/src/net/pool.rs index 982ac608..70fc1134 100644 --- a/cap-std/src/net/pool.rs +++ b/cap-std/src/net/pool.rs @@ -8,7 +8,7 @@ use std::{io, net}; /// /// This does not directly correspond to anything in `std`, however its methods /// correspond to the several functions in [`std::net`]. -#[derive(Clone)] +#[derive(Clone, Default)] pub struct Pool { cap: cap_primitives::net::Pool, }