Skip to content

Commit 549a290

Browse files
authored
Update README.md
1 parent 8a9a55c commit 549a290

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

docs/README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ The output of Cargo will be hidden unless compilation fails.
6060
//! [dependencies]
6161
//! time = "0.1.25"
6262
//! ```
63-
extern crate time;
6463
fn main() {
6564
println!("{}", time::now().rfc822z());
6665
}
@@ -74,7 +73,6 @@ The output of Cargo will be hidden unless compilation fails.
7473
// to be "*". Also, the `cargo-deps` comment *must* be a single-line
7574
// comment, and it *must* be the first thing in the file, after the
7675
// hashbang.
77-
extern crate time;
7876
fn main() {
7977
println!("{}", time::now().rfc822z());
8078
}
@@ -126,7 +124,6 @@ The code given is embedded into a block expression, evaluated, and printed out u
126124
Useful command-line arguments:
127125

128126
- `-d`/`--dep`: add a dependency to the generated `Cargo.toml` manifest.
129-
- `-x`/`--extern`: inject `extern crate` into generated script.
130127
- `-D`/`--dep-extern`: do both of the above.
131128
- `-t`/`--template`: Specify a custom template for this expression (see section on templates).
132129

@@ -137,9 +134,7 @@ You can use `rust-script` to write a quick filter, by specifying a closure to be
137134
```sh
138135
$ cat now.crs | rust-script --loop \
139136
"let mut n=0; move |l| {n+=1; println!(\"{:>6}: {}\",n,l.trim_right())}"
140-
Compiling loop v0.1.0 (file:///C:/Users/drk/AppData/Local/Cargo/script-cache/loop-58079283761aab8433b1)
141137
1: // cargo-deps: time="0.1.25"
142-
2: extern crate time;
143138
3: fn main() {
144139
4: println!("{}", time::now().rfc822z());
145140
5: }
@@ -150,12 +145,10 @@ You can achieve a similar effect to the above by using the `--count` flag, which
150145
```sh
151146
$ cat now.crs | rust-script --count --loop \
152147
"|l,n| println!(\"{:>6}: {}\", n, l.trim_right())"
153-
Compiling loop v0.1.0 (file:///C:/Users/drk/AppData/Local/Cargo/script-cache/loop-58079283761aab8433b1)
154148
1: // cargo-deps: time="0.1.25"
155-
2: extern crate time;
156-
3: fn main() {
157-
4: println!("{}", time::now().rfc822z());
158-
5: }
149+
2: fn main() {
150+
3: println!("{}", time::now().rfc822z());
151+
4: }
159152
```
160153
161154
Note that, like with expressions, you can specify a custom template for stream filters.
@@ -184,7 +177,6 @@ For example, a minimal expression template that adds a dependency and imports so
184177
// cargo-deps: itertools="0.6.2"
185178
#![allow(unused_imports)]
186179
#{prelude}
187-
extern crate itertools;
188180
use std::io::prelude::*;
189181
use std::mem;
190182
use itertools::Itertools;

0 commit comments

Comments
 (0)