Skip to content

Commit

Permalink
Replaced empty vec![] macros with Vec::new()
Browse files Browse the repository at this point in the history
  • Loading branch information
craigmayhew committed Feb 21, 2024
1 parent c0174fc commit 63b7a51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pages/archive/fermat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod fermat_utils {
}

fn generate_rows() -> std::vec::Vec<Node<Msg>> {
let mut html = vec![];
let mut html = Vec::new();
let two: usize = 2;

let fermats = fermat_utils::fermats();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/archive/mersenne.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ pub mod mersenne_utils {
}

pub fn render(model: &crate::Model) -> Node<Msg> {
let mut html = vec![];
let mut html = Vec::new();
let mersennes = mersenne_utils::mersennes();

for n in 1..mersennes.len() {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/archive/perfect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ pub mod perfects_utils {
}

pub fn render(model: &crate::Model) -> Node<Msg> {
let mut html = vec![];
let mut html = Vec::new();
let perfects = perfects_utils::perfects().to_owned();

for perfect in perfects.iter() {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/archive/prime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ pub fn render(slug: String) -> Node<Msg> {
NUMBERS_PER_PAGE,
);

let mut prime_vec_formatted = vec![];
let mut prime_vec_formatted = Vec::new();
for col in 1..COL_COUNT + 1 {
let mut prime_vec = vec![];
let mut prime_vec = Vec::new();
for i in NUMBERS_PER_COL * (col - 1)..NUMBERS_PER_COL * col {
// check data is available to display
if i >= primes.len() {
Expand All @@ -123,7 +123,7 @@ pub fn render(slug: String) -> Node<Msg> {
let prev_link: Vec<Node<_>>;
// we are on the first page of primes so don't display a previous button
if slug_int <= 1 {
prev_link = vec![];
prev_link = Vec::new();
//display a link with text "back to 1st prime numbers"
} else if slug_int as isize - NUMBERS_PER_PAGE as isize <= 0 {
href_prev = "/archive/prime/1/".to_string();
Expand Down

0 comments on commit 63b7a51

Please sign in to comment.