@@ -60,7 +60,6 @@ The output of Cargo will be hidden unless compilation fails.
60
60
// ! [dependencies]
61
61
// ! time = "0.1.25"
62
62
// ! ```
63
- extern crate time;
64
63
fn main () {
65
64
println! (" {}" , time :: now (). rfc822z ());
66
65
}
@@ -74,7 +73,6 @@ The output of Cargo will be hidden unless compilation fails.
74
73
// to be "*". Also, the `cargo-deps` comment *must* be a single-line
75
74
// comment, and it *must* be the first thing in the file, after the
76
75
// hashbang.
77
- extern crate time;
78
76
fn main () {
79
77
println! (" {}" , time :: now (). rfc822z ());
80
78
}
@@ -126,7 +124,6 @@ The code given is embedded into a block expression, evaluated, and printed out u
126
124
Useful command-line arguments:
127
125
128
126
- ` -d ` /` --dep ` : add a dependency to the generated ` Cargo.toml ` manifest.
129
- - ` -x ` /` --extern ` : inject ` extern crate ` into generated script.
130
127
- ` -D ` /` --dep-extern ` : do both of the above.
131
128
- ` -t ` /` --template ` : Specify a custom template for this expression (see section on templates).
132
129
@@ -137,9 +134,7 @@ You can use `rust-script` to write a quick filter, by specifying a closure to be
137
134
``` sh
138
135
$ cat now.crs | rust-script --loop \
139
136
" 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)
141
137
1: // cargo-deps: time=" 0.1.25"
142
- 2: extern crate time ;
143
138
3: fn main () {
144
139
4: println! (" {}" , time::now().rfc822z ());
145
140
5: }
@@ -150,12 +145,10 @@ You can achieve a similar effect to the above by using the `--count` flag, which
150
145
` ` ` sh
151
146
$ cat now.crs | rust-script --count --loop \
152
147
" |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)
154
148
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: }
159
152
` ` `
160
153
161
154
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
184
177
// cargo-deps: itertools="0.6.2"
185
178
#![allow(unused_imports)]
186
179
#{prelude}
187
- extern crate itertools;
188
180
use std::io::prelude::*;
189
181
use std::mem;
190
182
use itertools::Itertools;
0 commit comments