File tree Expand file tree Collapse file tree 6 files changed +12
-16
lines changed Expand file tree Collapse file tree 6 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ branches:
4
4
except :
5
5
- fuzzing
6
6
rust :
7
- - 1.26 .1
7
+ - 1.22 .1
8
8
- stable
9
9
- beta
10
10
- nightly
16
16
- RUST_LOG=multipart=trace RUST_BACKTRACE=1 ARGS=
17
17
matrix :
18
18
include :
19
- - rust : 1.22.1
20
19
- rust : stable
21
20
env : ARGS+=--no-default-features --features "nickel"
22
21
- rust : stable
23
22
env : ARGS+=--features "use_arc_str"
24
23
- rust : nightly
25
24
env : ARGS+=--features "nightly,rocket"
26
25
script :
27
- - |
28
- if [ ${TRAVIS_RUST_VERSION} = "1.22.1" ]; then
29
- # we can't test because `env_logger` uses `lazy_static 1.2.0` which needs Rust 1.26
30
- cargo build --no-default-features --features "mock,client,server" && exit 0;
31
- fi
32
26
- cargo build --verbose $ARGS;
33
27
- cargo test --verbose $ARGS -- --test-threads=1;
34
28
- cargo doc --verbose $ARGS;
Original file line number Diff line number Diff line change @@ -18,10 +18,12 @@ license = "MIT OR Apache-2.0"
18
18
readme = " README.md"
19
19
20
20
[dependencies ]
21
+ # lazy-static (pulled in by e.g. nickel, regex) is incompatible with 1.22.1
22
+ lazy_static = { version = " >=1.0,<1.2.0" , optional = true }
21
23
log = " 0.4"
22
24
mime = " 0.2"
23
25
mime_guess = " 1.8"
24
- rand = " 0.4 "
26
+ rand = " 0.6 "
25
27
safemem = { version = " 0.3" , optional = true }
26
28
tempdir = " 0.3"
27
29
clippy = { version = " >=0.0, <0.1" , optional = true }
Original file line number Diff line number Diff line change @@ -5,10 +5,7 @@ Client- and server-side abstractions for HTTP file uploads (POST requests with
5
5
Supports several different (** sync** hronous API) HTTP crates.
6
6
** Async** hronous (i.e. ` futures ` -based) API support will be provided by [ multipart-async] .
7
7
8
- Minimum supported Rust version: 1.22.1*
9
- * only ` mock ` , ` client ` and ` server ` features, only guaranteed to compile
10
-
11
- Fully tested Rust version: 1.26.1
8
+ Minimum supported Rust version: 1.22.1
12
9
13
10
### [ Documentation] ( http://docs.rs/multipart/ )
14
11
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ pub mod server;
119
119
mod local_test;
120
120
121
121
fn random_alphanumeric ( len : usize ) -> String {
122
- rand:: thread_rng ( ) . gen_ascii_chars ( ) . take ( len) . collect ( )
122
+ rand:: thread_rng ( ) . sample_iter ( & rand :: distributions :: Alphanumeric ) . take ( len) . collect ( )
123
123
}
124
124
125
125
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -301,16 +301,18 @@ fn gen_bool() -> bool {
301
301
}
302
302
303
303
fn gen_string ( ) -> String {
304
+ use rand:: distributions:: Alphanumeric ;
305
+
304
306
let mut rng_1 = rand:: thread_rng ( ) ;
305
307
let mut rng_2 = rand:: thread_rng ( ) ;
306
308
307
309
let str_len_1 = rng_1. gen_range ( MIN_LEN , MAX_LEN + 1 ) ;
308
310
let str_len_2 = rng_2. gen_range ( MIN_LEN , MAX_LEN + 1 ) ;
309
311
let num_dashes = rng_1. gen_range ( 0 , MAX_DASHES + 1 ) ;
310
312
311
- rng_1. gen_ascii_chars ( ) . take ( str_len_1)
313
+ rng_1. sample_iter ( & Alphanumeric ) . take ( str_len_1)
312
314
. chain ( iter:: repeat ( '-' ) . take ( num_dashes) )
313
- . chain ( rng_2. gen_ascii_chars ( ) . take ( str_len_2) )
315
+ . chain ( rng_2. sample_iter ( & Alphanumeric ) . take ( str_len_2) )
314
316
. collect ( )
315
317
}
316
318
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ use std::cell::{Cell, RefCell};
9
9
use std:: io:: { self , Read , Write } ;
10
10
use std:: { fmt, thread} ;
11
11
12
- use rand:: { self , Rng , ThreadRng } ;
12
+ use rand:: { self , Rng } ;
13
+ use rand:: prelude:: ThreadRng ;
13
14
14
15
/// A mock implementation of `client::HttpRequest` which can spawn an `HttpBuffer`.
15
16
///
You can’t perform that action at this time.
0 commit comments