Skip to content

Commit

Permalink
Merge pull request #159 from AndyGauge/2018-example
Browse files Browse the repository at this point in the history
Update examples for 2018 edition
  • Loading branch information
LukasKalbertodt committed Jan 13, 2020
2 parents 4216696 + fb3c549 commit 746a0f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,8 @@ language: rust
matrix:
include:
- rust: 1.27.2
script:
- cargo test --all-targets
- rust: stable
script:
- cargo test
Expand Down
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -39,9 +39,7 @@ lazy_static = "1.4.0"
# Example

```rust
#[macro_use]
extern crate lazy_static;

use lazy_static::lazy_static;
use std::collections::HashMap;

lazy_static! {
Expand Down
11 changes: 4 additions & 7 deletions src/lib.rs
Expand Up @@ -27,8 +27,8 @@ lazy_static! {
Attributes (including doc comments) are supported as well:
```rust
# #[macro_use]
# extern crate lazy_static;
use lazy_static::lazy_static;
# fn main() {
lazy_static! {
/// This is an example for using doc comment attributes
Expand Down Expand Up @@ -58,9 +58,7 @@ have generally the same properties as regular "static" variables:
Using the macro:
```rust
#[macro_use]
extern crate lazy_static;
use lazy_static::lazy_static;
use std::collections::HashMap;
lazy_static! {
Expand Down Expand Up @@ -195,8 +193,7 @@ pub trait LazyStatic {
/// Example:
///
/// ```rust
/// #[macro_use]
/// extern crate lazy_static;
/// use lazy_static::lazy_static;
///
/// lazy_static! {
/// static ref BUFFER: Vec<u8> = (0..255).collect();
Expand Down

0 comments on commit 746a0f0

Please sign in to comment.