Skip to content

Commit 746a0f0

Browse files
Merge pull request #159 from AndyGauge/2018-example
Update examples for 2018 edition
2 parents 4216696 + fb3c549 commit 746a0f0

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ language: rust
22
matrix:
33
include:
44
- rust: 1.27.2
5+
script:
6+
- cargo test --all-targets
57
- rust: stable
68
script:
79
- cargo test

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ lazy_static = "1.4.0"
3939
# Example
4040

4141
```rust
42-
#[macro_use]
43-
extern crate lazy_static;
44-
42+
use lazy_static::lazy_static;
4543
use std::collections::HashMap;
4644

4745
lazy_static! {

src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ lazy_static! {
2727
Attributes (including doc comments) are supported as well:
2828
2929
```rust
30-
# #[macro_use]
31-
# extern crate lazy_static;
30+
use lazy_static::lazy_static;
31+
3232
# fn main() {
3333
lazy_static! {
3434
/// This is an example for using doc comment attributes
@@ -58,9 +58,7 @@ have generally the same properties as regular "static" variables:
5858
Using the macro:
5959
6060
```rust
61-
#[macro_use]
62-
extern crate lazy_static;
63-
61+
use lazy_static::lazy_static;
6462
use std::collections::HashMap;
6563
6664
lazy_static! {
@@ -195,8 +193,7 @@ pub trait LazyStatic {
195193
/// Example:
196194
///
197195
/// ```rust
198-
/// #[macro_use]
199-
/// extern crate lazy_static;
196+
/// use lazy_static::lazy_static;
200197
///
201198
/// lazy_static! {
202199
/// static ref BUFFER: Vec<u8> = (0..255).collect();

0 commit comments

Comments
 (0)