File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -478,9 +478,26 @@ pub mod builtin {
478
478
///
479
479
/// # Examples
480
480
///
481
+ /// Assume there are two files in the same directory with the following
482
+ /// contents:
483
+ ///
484
+ /// File 'spanish.in':
485
+ ///
486
+ /// ```text
487
+ /// adiós
488
+ /// ```
489
+ ///
490
+ /// File 'main.rs':
491
+ ///
481
492
/// ```ignore (cannot-doctest-external-file-dependency)
482
- /// let secret_key = include_bytes!("secret-key.bin");
493
+ /// fn main() {
494
+ /// let bytes = include_bytes!("spanish.in");
495
+ /// assert_eq!(bytes, b"adi\xc3\xb3s\n");
496
+ /// print!("{}", String::from_utf8_lossy(bytes));
497
+ /// }
483
498
/// ```
499
+ ///
500
+ /// Compiling 'main.rs' and running the resulting binary will print "adiós".
484
501
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
485
502
#[ macro_export]
486
503
macro_rules! include_bytes { ( $file: expr) => ( { /* compiler built-in */ } ) }
You can’t perform that action at this time.
0 commit comments