From 36678bf8ee7228034bae5b0222bae88b57d5384b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fuhry?= Date: Wed, 31 May 2023 22:57:29 +0200 Subject: [PATCH] changed fill_with_random() output and input --- src/graph/matrix.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graph/matrix.rs b/src/graph/matrix.rs index 004a748..f7d92a7 100644 --- a/src/graph/matrix.rs +++ b/src/graph/matrix.rs @@ -1,7 +1,8 @@ #[allow(unused_imports)] use std::{fs::File, io::Read}; -pub fn fill_with_random(matrix: &mut Vec>, size: usize) { +pub fn fill_with_random(size: usize) -> Vec> { + let mut matrix: Vec> = vec![]; for i in 0..size { matrix.push(vec![]); for j in 0..size { @@ -12,6 +13,7 @@ pub fn fill_with_random(matrix: &mut Vec>, size: usize) { matrix[i].push(fastrand::usize(0..2)); } } + matrix } pub fn mult(matrix1: &Vec>, matrix2: &Vec>) -> Vec> {