diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-12-05 18:59:48 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-12-21 12:09:43 +0100 |
| commit | 4f30a24e42137149373311f20525ac52cff44d94 (patch) | |
| tree | 96000e98815cd296ffeaaa5030af03888474ee78 /src/libstd | |
| parent | 6d34ec18c7d7e574553f6347ecf08e1e1c45c13d (diff) | |
| download | rust-4f30a24e42137149373311f20525ac52cff44d94.tar.gz rust-4f30a24e42137149373311f20525ac52cff44d94.zip | |
Inline tweaks
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 479e6dccb90..7195175db28 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -740,6 +740,7 @@ impl<K, V> RawTable<K, V> { } } + #[inline] fn new_internal( capacity: usize, fallibility: Fallibility, @@ -755,12 +756,14 @@ impl<K, V> RawTable<K, V> { /// Tries to create a new raw table from a given capacity. If it cannot allocate, /// it returns with AllocErr. + #[inline] pub fn try_new(capacity: usize) -> Result<RawTable<K, V>, CollectionAllocErr> { Self::new_internal(capacity, Fallible) } /// Creates a new raw table from a given capacity. All buckets are /// initially empty. + #[inline] pub fn new(capacity: usize) -> RawTable<K, V> { match Self::new_internal(capacity, Infallible) { Err(CollectionAllocErr::CapacityOverflow) => panic!("capacity overflow"), |
