File tree 1 file changed +2
-1
lines changed
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -481,6 +481,7 @@ impl Error {
481
481
/// originate from the OS itself. The `error` argument is an arbitrary
482
482
/// payload which will be contained in this [`Error`].
483
483
///
484
+ /// Note that this function allocates memory on the heap.
484
485
/// If no extra payload is required, use the `From` conversion from
485
486
/// `ErrorKind`.
486
487
///
@@ -495,7 +496,7 @@ impl Error {
495
496
/// // errors can also be created from other errors
496
497
/// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error);
497
498
///
498
- /// // creating an error without payload
499
+ /// // creating an error without payload (and without memory allocation)
499
500
/// let eof_error = Error::from(ErrorKind::UnexpectedEof);
500
501
/// ```
501
502
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
You can’t perform that action at this time.
0 commit comments