Skip to content

Commit 5c16116

Browse files
authored
Merge pull request #1383 from 0ndorio/static_lifetime_example_missing_main
Add missing main function in static life time example.
2 parents d301b3a + 2ed758e commit 5c16116

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/scope/lifetime/static_lifetime.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ does not:
7575
```rust,editable,compile_fail
7676
use std::fmt::Debug;
7777
78-
fn print_it( input: impl Debug + 'static )
79-
{
78+
fn print_it( input: impl Debug + 'static ) {
8079
println!( "'static value passed in is: {:?}", input );
8180
}
8281
83-
fn use_it()
84-
{
82+
fn main() {
8583
// i is owned and contains no references, thus it's 'static:
8684
let i = 5;
8785
print_it(i);

0 commit comments

Comments
 (0)