File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 10
10
11
11
//! Unicode string slices.
12
12
//!
13
- //! The `&str` type is one of the two main string types, the other being `String`. Unlike its `String` counterpart, its contents
14
- //! are borrowed and therefore cannot be moved someplace else.
13
+ //! The `&str` type is one of the two main string types, the other being `String`.
14
+ //! Unlike its `String` counterpart, its contents are borrowed and therefore
15
+ //! cannot be moved someplace else.
15
16
//!
16
17
//! # Basic Usage
17
18
//! A basic string declaration of `&str` type:
22
23
//!
23
24
//! Here we have declared a string literal, also known as a string slice.
24
25
//! String literals have a static lifetime, which means the string `hello_world`
25
- //! is guaranteed to be valid for the duration of the entire program. We can explicitly specify
26
- //! `hello_world`'s lifetime as well:
26
+ //! is guaranteed to be valid for the duration of the entire program.
27
+ //! We can explicitly specify `hello_world`'s lifetime as well:
27
28
//!
28
29
//! ```
29
30
//! let hello_world:&'static str = "Hello, world!";
You can’t perform that action at this time.
0 commit comments