Fix Rust linting error
This commit is contained in:
parent
63652726c3
commit
f628117529
1 changed files with 5 additions and 4 deletions
|
@ -10,8 +10,9 @@
|
|||
|
||||
//! Unicode string slices.
|
||||
//!
|
||||
//! The `&str` type is one of the two main string types, the other being `String`. Unlike its `String` counterpart, its contents
|
||||
//! are borrowed and therefore cannot be moved someplace else.
|
||||
//! The `&str` type is one of the two main string types, the other being `String`.
|
||||
//! Unlike its `String` counterpart, its contents are borrowed and therefore
|
||||
//! cannot be moved someplace else.
|
||||
//!
|
||||
//! # Basic Usage
|
||||
//! A basic string declaration of `&str` type:
|
||||
|
@ -22,8 +23,8 @@
|
|||
//!
|
||||
//! Here we have declared a string literal, also known as a string slice.
|
||||
//! String literals have a static lifetime, which means the string `hello_world`
|
||||
//! is guaranteed to be valid for the duration of the entire program. We can explicitly specify
|
||||
//! `hello_world`'s lifetime as well:
|
||||
//! is guaranteed to be valid for the duration of the entire program.
|
||||
//! We can explicitly specify `hello_world`'s lifetime as well:
|
||||
//!
|
||||
//! ```
|
||||
//! let hello_world:&'static str = "Hello, world!";
|
||||
|
|
Loading…
Add table
Reference in a new issue