Skip to content

Commit

Permalink
Add try_into for usize to isize
Browse files Browse the repository at this point in the history
  • Loading branch information
enavarro51 committed Nov 24, 2023
1 parent 500a1e0 commit fd7544a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ fixes:
Fixed an issue where the :func:`~rustworkx.generators.directed_gnp_random_graph`
and the :func:`~rustworkx-core.generators.gnp_random_graph` for directed graphs
produced a graph where lower node numbers had only a small number of edges
compared to what was expected and the output was therefore not random.
compared to what was expected.
2 changes: 1 addition & 1 deletion rustworkx-core/src/generators/random_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ where
}
}
} else {
let num_nodes = num_nodes as isize;
let num_nodes: isize = num_nodes.try_into().map_err(|_| InvalidInputError).unwrap();
let lp: f64 = (1.0 - probability).ln();
let between = Uniform::new(0.0, 1.0);

Expand Down

0 comments on commit fd7544a

Please sign in to comment.