Skip to content

Commit 23f6a64

Browse files
authored
Bump MSRV to 1.41, update dependencies (#444)
* Bump MSRV to 1.41 * Update dependencies Cannot update quickcheck yet * Missing fixes in serialization-tests
1 parent f15595b commit 23f6a64

9 files changed

Lines changed: 91 additions & 90 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
include:
19-
- rust: 1.37.0 # MSRV
19+
- rust: 1.41.0 # MSRV
2020
- rust: stable
2121
features: unstable quickcheck
2222
test_all: --all

‎Cargo.toml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ bench = false
2929
debug = true
3030

3131
[dependencies]
32-
fixedbitset = { version = "0.3.0", default-features = false }
32+
fixedbitset = { version = "0.4.0", default-features = false }
3333
quickcheck = { optional = true, version = "0.8", default-features = false }
34-
indexmap = { version = "1.0.2" }
34+
indexmap = { version = "1.6.2" }
3535
serde = { version = "1.0", optional = true }
3636
serde_derive = { version = "1.0", optional = true }
3737

3838
[dev-dependencies]
3939
rand = "0.5.5"
40-
odds = { version = "0.2.19" }
41-
defmac = "0.1"
42-
itertools = { version = "0.8", default-features = false }
40+
odds = { version = "0.4.0" }
41+
defmac = "0.2.1"
42+
itertools = { version = "0.10.1", default-features = false }
4343
bincode = "1.3.3"
4444

4545
[features]

‎README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
petgraph
33
========
44

5-
Graph data structure library. Known to support Rust 1.37 and later.
5+
Graph data structure library. Supports Rust 1.41 and later.
66

77
Please read the `API documentation here`__
88

‎serialization-tests/Cargo.toml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ repository = "https://github.com/bluss/petgraph"
1515

1616
[dependencies]
1717
petgraph = { path = "..", features = ["serde-1", "quickcheck"] }
18-
itertools = { version = "0.6.2" }
18+
itertools = { version = "0.10.1" }
1919

2020
[dev-dependencies]
2121
serde_json = "1.0"
2222
quickcheck = { version = "0.8", default-features = false }
23-
bincode = "1.0.1"
24-
defmac = "0.1"
23+
bincode = "1.3.3"
24+
defmac = "0.2.1"

‎serialization-tests/tests/serialization.rs‎

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ defmac!(rejson ref g => fromjson!(tojson!(g)));
167167
#[test]
168168
fn json_graph_str_i32() {
169169
let g1: DiGraph<_, _> = make_graph();
170-
let g2: Graph<String, i32> = rejson!(g1);
170+
let g2: Graph<String, i32> = rejson!(&g1);
171171
assert_graph_eq(&g1, &g2);
172172
assert_graph_eq(&g2, &g1);
173173
}
@@ -176,7 +176,7 @@ fn json_graph_str_i32() {
176176
fn json_graph_nils() {
177177
let g1 = make_graph().map(|_, _| (), |_, _| ());
178178

179-
let g2: Graph<(), ()> = rejson!(g1);
179+
let g2: Graph<(), ()> = rejson!(&g1);
180180
assert_graph_eq(&g1, &g2);
181181
assert_graph_eq(&g2, &g1);
182182
}
@@ -212,42 +212,42 @@ type DiGraphStrI32 = DiGraph<String, i32>;
212212

213213
#[test]
214214
fn from_json_digraph_nils() {
215-
let _: DiGraphNils = fromjson!(DIGRAPH_NILS);
215+
let _: DiGraphNils = fromjson!(&DIGRAPH_NILS);
216216
}
217217

218218
#[test]
219219
#[should_panic(expected = "edge property mismatch")]
220220
fn from_json_graph_nils_edge_property_mismatch() {
221-
let _: UnGraphNils = fromjson!(DIGRAPH_NILS);
221+
let _: UnGraphNils = fromjson!(&DIGRAPH_NILS);
222222
}
223223

224224
#[test]
225225
#[should_panic(expected = "does not exist")]
226226
fn from_json_graph_nils_index_oob() {
227-
let _: DiGraphNils = fromjson!(DIGRAPH_NILS_INDEX_OOB);
227+
let _: DiGraphNils = fromjson!(&DIGRAPH_NILS_INDEX_OOB);
228228
}
229229

230230
#[test]
231231
#[should_panic(expected = "expected u8")]
232232
fn from_json_graph_nils_index_too_large() {
233-
let _: DiGraphNilsU8 = fromjson!(DIGRAPH_NILS_INDEX_OUTSIDE_U8);
233+
let _: DiGraphNilsU8 = fromjson!(&DIGRAPH_NILS_INDEX_OUTSIDE_U8);
234234
}
235235

236236
#[test]
237237
fn from_json_graph_directed_str_i32() {
238-
let _: DiGraphStrI32 = fromjson!(DIGRAPH_STRI32);
238+
let _: DiGraphStrI32 = fromjson!(&DIGRAPH_STRI32);
239239
}
240240

241241
#[test]
242242
#[should_panic(expected = "expected unit")]
243243
fn from_json_graph_from_edge_type_1() {
244-
let _: DiGraphNils = fromjson!(DIGRAPH_STRI32);
244+
let _: DiGraphNils = fromjson!(&DIGRAPH_STRI32);
245245
}
246246

247247
#[test]
248248
#[should_panic(expected = "expected a string")]
249249
fn from_json_graph_from_edge_type_2() {
250-
let _: DiGraphStrI32 = fromjson!(DIGRAPH_NILS);
250+
let _: DiGraphStrI32 = fromjson!(&DIGRAPH_NILS);
251251
}
252252

253253
#[test]
@@ -268,7 +268,7 @@ fn from_json_digraph_str_i32() {
268268
type GSI = DiGraph<String, i32>;
269269
type GSISmall = DiGraph<String, i32, u8>;
270270

271-
let g4: GSI = fromjson!(DIGRAPH_STRI32);
271+
let g4: GSI = fromjson!(&DIGRAPH_STRI32);
272272

273273
for ni in g4.node_indices() {
274274
assert_eq!(&g4nodes[ni.index()], &g4[ni]);
@@ -283,7 +283,7 @@ fn from_json_digraph_str_i32() {
283283
assert_eq!(edge_data[2], g4[e.id()]);
284284
}
285285

286-
let _g4small: GSISmall = fromjson!(DIGRAPH_STRI32);
286+
let _g4small: GSISmall = fromjson!(&DIGRAPH_STRI32);
287287
}
288288

289289
#[test]
@@ -313,12 +313,12 @@ fn from_json_nodes_too_big() {
313313
type H1 = DiGraph<i32, i32>;
314314

315315
assert!(from_str::<G8>(j1_big).is_err());
316-
let _: G16 = fromjson!(j1_big); // assert
317-
let _: G32 = fromjson!(j1_big); // assert
318-
let _: G64 = fromjson!(j1_big); // assert
316+
let _: G16 = fromjson!(&j1_big); // assert
317+
let _: G32 = fromjson!(&j1_big); // assert
318+
let _: G64 = fromjson!(&j1_big); // assert
319319

320320
// other edge weight is also ok -- because it has no edges
321-
let _: H1 = fromjson!(j1_big); // assert
321+
let _: H1 = fromjson!(&j1_big); // assert
322322
}
323323

324324
#[test]
@@ -343,15 +343,15 @@ fn from_json_edges_too_big() {
343343

344344
assert!(from_str::<G8>(&j1_big).is_err());
345345
assert!(from_str::<G16>(&j1_big).is_err());
346-
let _: G32 = fromjson!(j1_big); // assert
347-
let _: G64 = fromjson!(j1_big); // assert
346+
let _: G32 = fromjson!(&j1_big); // assert
347+
let _: G64 = fromjson!(&j1_big); // assert
348348
}
349349

350350
#[test]
351351
fn json_stable_graph_str() {
352352
let g1 = make_stable_graph();
353353

354-
let g2: StableGraph<String, i32> = rejson!(g1);
354+
let g2: StableGraph<String, i32> = rejson!(&g1);
355355

356356
// map &str -> String
357357
let g1 = g1.map(|_, s| s.to_string(), |_, &w| w);
@@ -361,7 +361,7 @@ fn json_stable_graph_str() {
361361
#[test]
362362
fn json_stable_graph_nils() {
363363
let g1 = make_stable_graph().map(|_, _| (), |_, _| ());
364-
let g2 = rejson!(g1);
364+
let g2 = rejson!(&g1);
365365
assert_stable_graph_eq(&g1, &g2);
366366
}
367367

@@ -373,14 +373,14 @@ defmac!(recode ref g => decode!(encode!(g)));
373373
#[test]
374374
fn bincode_stablegraph_to_graph_i32_0() {
375375
let g1 = StableGraph::<i32, i32>::new();
376-
let g2: Graph<i32, i32> = recode!(g1);
376+
let g2: Graph<i32, i32> = recode!(&g1);
377377
assert_graph_eq(&g2, &Graph::<i32, i32>::default());
378378
}
379379

380380
#[test]
381381
fn bincode_graph_to_stablegraph_i32_0() {
382382
let g1 = Graph::<i32, i32>::new();
383-
let g2: StableGraph<i32, i32> = recode!(g1);
383+
let g2: StableGraph<i32, i32> = recode!(&g1);
384384
assert_stable_graph_eq(&g2, &StableGraph::<i32, i32>::default());
385385
}
386386

@@ -389,7 +389,7 @@ fn bincode_graph_to_graph_i32_1() {
389389
let mut g1 = Graph::<i32, i32>::new();
390390
let x = 1729;
391391
g1.add_node(x);
392-
let g2: Graph<i32, i32> = recode!(g1);
392+
let g2: Graph<i32, i32> = recode!(&g1);
393393

394394
assert_graph_eq(&g1, &g2);
395395
}
@@ -406,7 +406,7 @@ fn bincode_stablegraph_added2_removed2() {
406406
let b = g1.add_node(x + 1);
407407
g1.remove_node(a);
408408
g1.remove_node(b);
409-
let g2: StableGraph<i32, i32> = recode!(g1);
409+
let g2: StableGraph<i32, i32> = recode!(&g1);
410410

411411
assert_stable_graph_eq(&g1, &g2);
412412
}
@@ -424,7 +424,7 @@ fn bincode_stablegraph_added3_removed2() {
424424
let _c = g1.add_node(x + 2);
425425
g1.remove_node(a);
426426
g1.remove_node(b);
427-
let g2: StableGraph<i32, i32> = recode!(g1);
427+
let g2: StableGraph<i32, i32> = recode!(&g1);
428428

429429
assert_stable_graph_eq(&g1, &g2);
430430
}
@@ -434,7 +434,7 @@ fn bincode_stablegraph_to_graph_i32_1() {
434434
let mut g1 = StableGraph::<i32, i32>::new();
435435
let x = 1729;
436436
g1.add_node(x);
437-
let g2: Graph<i32, i32> = recode!(g1);
437+
let g2: Graph<i32, i32> = recode!(&g1);
438438

439439
assert_eq!(g2.node_count(), 1);
440440
assert_eq!(g2.edge_count(), 0);
@@ -443,47 +443,47 @@ fn bincode_stablegraph_to_graph_i32_1() {
443443

444444
quickcheck! {
445445
fn json_graph_to_stablegraph_to_graph(g1: Graph<i32, i32>) -> () {
446-
let sg: StableGraph<i32, i32> = rejson!(g1);
447-
let g2: Graph<i32, i32> = rejson!(sg);
446+
let sg: StableGraph<i32, i32> = rejson!(&g1);
447+
let g2: Graph<i32, i32> = rejson!(&sg);
448448
assert_graph_eq(&g1, &g2);
449449
}
450450

451451
fn json_stablegraph_to_stablegraph(g1: StableGraph<i32, i32>) -> () {
452-
let sg: StableGraph<i32, i32> = rejson!(g1);
452+
let sg: StableGraph<i32, i32> = rejson!(&g1);
453453
assert_stable_graph_eq(&g1, &sg);
454454
}
455455

456456
fn json_graph_to_bigger_graph(g1: DiGraph<i32, i32, u16>) -> () {
457-
let g2: DiGraph<i32, i32, usize> = rejson!(g1);
458-
let g3: DiGraph<i32, i32, u16> = rejson!(g2);
457+
let g2: DiGraph<i32, i32, usize> = rejson!(&g1);
458+
let g3: DiGraph<i32, i32, u16> = rejson!(&g2);
459459
assert_graph_eq(&g1, &g3);
460460
}
461461

462462
fn bincode_graph_to_graph_nils(g1: Graph<(), ()>) -> () {
463-
let g2: Graph<(), ()> = recode!(g1);
463+
let g2: Graph<(), ()> = recode!(&g1);
464464
assert_graph_eq(&g1, &g2);
465465
}
466466

467467
fn bincode_graph_to_stablegraph_to_graph_nils(g1: Graph<(), ()>) -> () {
468-
let data = encode!(g1);
469-
let sg: StableGraph<(), ()> = decode!(data);
470-
let data2 = encode!(sg);
471-
let g2: Graph<(), ()> = decode!(data2);
468+
let data = encode!(&g1);
469+
let sg: StableGraph<(), ()> = decode!(&data);
470+
let data2 = encode!(&sg);
471+
let g2: Graph<(), ()> = decode!(&data2);
472472
assert_eq!(data, data2);
473473
assert_graph_eq(&g1, &g2);
474474
}
475475

476476
fn bincode_graph_to_stablegraph_to_graph_u16(g1: DiGraph<i32, i32, u16>) -> () {
477-
let data = encode!(g1);
478-
let sg: StableDiGraph<i32, i32, u16> = decode!(data);
479-
let data2 = encode!(sg);
480-
let g2: DiGraph<i32, i32, u16> = decode!(data2);
477+
let data = encode!(&g1);
478+
let sg: StableDiGraph<i32, i32, u16> = decode!(&data);
479+
let data2 = encode!(&sg);
480+
let g2: DiGraph<i32, i32, u16> = decode!(&data2);
481481
assert_eq!(data, data2);
482482
assert_graph_eq(&g1, &g2);
483483
}
484484

485485
fn bincode_stablegraph_to_stablegraph(g1: StableGraph<i32, i32>) -> () {
486-
let g2: StableGraph<i32, i32> = recode!(g1);
486+
let g2: StableGraph<i32, i32> = recode!(&g1);
487487
assert_stable_graph_eq(&g1, &g2);
488488
}
489489
}

‎src/quickcheck.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn random_01<G: Gen>(g: &mut G) -> f64 {
1515
// from rand
1616
let bits = 53;
1717
let scale = 1. / ((1u64 << bits) as f64);
18-
let x = g.next_u64();
18+
let x: u64 = Arbitrary::arbitrary(g);
1919
(x >> (64 - bits)) as f64 * scale
2020
}
2121

‎tests/list.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ fn test_edges_directed() {
140140
let gr = make_graph();
141141
dbg!(&gr);
142142
let x = n(9);
143-
assert_equal(edges!(gr, x), vec![(1, 11), (x, 12), (x, 13)]);
144-
assert_equal(edges!(gr, n(0)), vec![(n(3), 1)]);
145-
//assert_equal(edges!(gr, n(4)), vec![]);
143+
assert_equal(edges!(&gr, x), vec![(1, 11), (x, 12), (x, 13)]);
144+
assert_equal(edges!(&gr, n(0)), vec![(n(3), 1)]);
145+
//assert_equal(edges!(&gr, n(4)), vec![]);
146146
}
147147

148148
#[test]

0 commit comments

Comments
 (0)