Skip to content

Commit ceb7a6e

Browse files
committed
Fixed the warnings in code
1 parent 5f3e986 commit ceb7a6e

18 files changed

+70
-13
lines changed

e2etests/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ pub fn get_chat_session() -> &'static Mutex<q_chat_helper::QChatSession> {
1313
println!("✅ Q Chat session started");
1414
CHAT_SESSION = Some(Mutex::new(chat));
1515
});
16-
CHAT_SESSION.as_ref().unwrap()
16+
(&raw const CHAT_SESSION).as_ref().unwrap().as_ref().unwrap()
1717
}
1818
}
1919

2020
pub fn cleanup_if_last_test(test_count: &AtomicUsize, total_tests: usize) -> Result<usize, Box<dyn std::error::Error>> {
2121
let count = test_count.fetch_add(1, Ordering::SeqCst) + 1;
2222
if count == total_tests {
2323
unsafe {
24-
if let Some(session) = &CHAT_SESSION {
24+
if let Some(session) = (&raw const CHAT_SESSION).as_ref().unwrap() {
2525
if let Ok(mut chat) = session.lock() {
2626
chat.quit()?;
2727
println!("✅ Test completed successfully");

e2etests/tests/agent/test_agent_commands.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::{get_chat_session, cleanup_if_last_test};
2-
use std::sync::atomic::{AtomicUsize, Ordering};
3+
use std::sync::atomic::AtomicUsize;
34

5+
#[allow(dead_code)]
46
static TEST_COUNT: AtomicUsize = AtomicUsize::new(0);
57

8+
#[allow(dead_code)]
69
const TEST_NAMES: &[&str] = &[
710
"agent_without_subcommand",
811
"test_agent_create_command",
@@ -14,6 +17,7 @@ const TEST_NAMES: &[&str] = &[
1417
"test_agent_set_default_command",
1518
"test_agent_set_default_missing_args",
1619
];
20+
#[allow(dead_code)]
1721
const TOTAL_TESTS: usize = TEST_NAMES.len();
1822

1923
#[test]

e2etests/tests/ai_prompts/test_ai_prompt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::q_chat_helper::QChatSession;
23

34
#[test]

e2etests/tests/ai_prompts/test_prompts_commands.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::{get_chat_session, cleanup_if_last_test};
2-
use std::sync::atomic::{AtomicUsize, Ordering};
3+
use std::sync::atomic::AtomicUsize;
34

5+
#[allow(dead_code)]
46
static TEST_COUNT: AtomicUsize = AtomicUsize::new(0);
57

68
// List of covered tests
9+
#[allow(dead_code)]
710
const TEST_NAMES: &[&str] = &[
811
"test_prompts_command",
912
"test_prompts_help_command",
1013
"test_prompts_list_command",
1114
];
15+
#[allow(dead_code)]
1216
const TOTAL_TESTS: usize = TEST_NAMES.len();
1317

1418

e2etests/tests/context/test_context_command.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::{get_chat_session, cleanup_if_last_test};
23
use std::sync::atomic::{AtomicUsize};
34

5+
#[allow(dead_code)]
46
static TEST_COUNT: AtomicUsize = AtomicUsize::new(0);
57

68
// List of covered tests
9+
#[allow(dead_code)]
710
const TEST_NAMES: &[&str] = &[
811
"test_context_show_command",
912
"test_context_help_command",
@@ -16,6 +19,7 @@ const TEST_NAMES: &[&str] = &[
1619
"test_clear_context_command",
1720
"test_add_remove_multiple_file_context"
1821
];
22+
#[allow(dead_code)]
1923
const TOTAL_TESTS: usize = TEST_NAMES.len();
2024

2125
#[test]

e2etests/tests/core_session/test_clear_command.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::q_chat_helper::QChatSession;
23

34
#[test]

e2etests/tests/core_session/test_help_command.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::q_chat_helper::QChatSession;
23

34
#[test]

e2etests/tests/core_session/test_quit_command.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::q_chat_helper::QChatSession;
23

34
#[test]

e2etests/tests/core_session/test_tools_command.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::{get_chat_session, cleanup_if_last_test};
2-
use std::sync::atomic::{AtomicUsize, Ordering};
3+
use std::sync::atomic::AtomicUsize;
34

5+
#[allow(dead_code)]
46
static TEST_COUNT: AtomicUsize = AtomicUsize::new(0);
57

68
// List of covered tests
9+
#[allow(dead_code)]
710
const TEST_NAMES: &[&str] = &[
811
"test_tools_command",
912
"test_tools_help_command",
@@ -15,6 +18,7 @@ const TEST_NAMES: &[&str] = &[
1518
"test_tools_untrust_help_command",
1619
"test_tools_schema_help_command",
1720
];
21+
#[allow(dead_code)]
1822
const TOTAL_TESTS: usize = TEST_NAMES.len();
1923

2024
#[test]

e2etests/tests/integration/test_editor_help_command.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
#[allow(unused_imports)]
12
use q_cli_e2e_tests::{get_chat_session, cleanup_if_last_test};
2-
use std::sync::atomic::{AtomicUsize, Ordering};
3+
use std::sync::atomic::AtomicUsize;
34

5+
#[allow(dead_code)]
46
static TEST_COUNT: AtomicUsize = AtomicUsize::new(0);
57

68
// List of covered tests
9+
#[allow(dead_code)]
710
const TEST_NAMES: &[&str] = &[
811
"test_editor_help_command",
912
"test_help_editor_command",
1013
];
14+
#[allow(dead_code)]
1115
const TOTAL_TESTS: usize = TEST_NAMES.len();
1216

1317
#[test]

0 commit comments

Comments
 (0)