From 562e2bed2188f84519d47b6984f97b4e7bc25d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= Date: Tue, 3 Dec 2024 15:05:28 +0800 Subject: [PATCH] chore: fix test code lint --- tests/category.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/category.rs b/tests/category.rs index cb80556..6497d4f 100644 --- a/tests/category.rs +++ b/tests/category.rs @@ -37,7 +37,7 @@ async fn test_category() -> Result<()> { assert!(success); - let mut new_category_id: Vec = Vec::new(); + let mut new_category_ids: Vec = Vec::new(); for i in 0..10 { let response = client @@ -67,7 +67,7 @@ async fn test_category() -> Result<()> { assert!(success); println!("Created category: {}", data.id); - new_category_id.push(data.id); + new_category_ids.push(data.id); } let response = client @@ -93,9 +93,9 @@ async fn test_category() -> Result<()> { assert!(success); println!("Listed categories: {:#?}", data); - for i in 0..10 { + for new_category_id in new_category_ids.iter().take(10) { let response = client - .post(format!("/category/delete/{}", new_category_id[i])) + .post(format!("/category/delete/{}", new_category_id)) .json(&CreateCategory { id: &id, token: &token,