Skip to content

Commit 6156cfa

Browse files
authored
Update 2116-alloc-me-maybe.md
Add rust syntax highlighting tags to two code blocks
1 parent 859b254 commit 6156cfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/2116-alloc-me-maybe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ fn main() {
233233

234234
`try_reserve` and `try_reserve_exact` would be added to `HashMap`, `Vec`, `String`, and `VecDeque`. These would have the exact same APIs as their infallible counterparts, except that OOM would be exposed as an error case, rather than a call to `Alloc::oom()`. They would have the following signatures:
235235

236-
```
236+
```rust
237237
/// Tries to reserve capacity for at least `additional` more elements to be inserted
238238
/// in the given `Vec<T>`. The collection may reserve more space to avoid
239239
/// frequent reallocations. After calling `reserve`, capacity will be
@@ -261,7 +261,7 @@ pub enum CollectionAllocErr {
261261

262262
We propose only these methods because they represent a minimal building block that third parties can develop fallible allocation APIs on top of. For instance, here are some basic implementations:
263263

264-
```
264+
```rust
265265
impl<T> FallibleVecExt<T> for Vec<T> {
266266
fn try_push(&mut self, val: T) -> Result<(), (T, Err)> {
267267
if let Err(err) = self.try_reserve(1) { return Err((val, err)) }

0 commit comments

Comments
 (0)