From c014696cdcff5aea3a6957d75fcacee4244fc515 Mon Sep 17 00:00:00 2001 From: germ3n Date: Mon, 20 Jan 2025 11:44:53 +0100 Subject: [PATCH] remove unused imports --- tig-native-wrapper/src/dylib.rs | 9 ++------- tig-native-wrapper/src/main.rs | 10 ++++------ tig-native-wrapper/src/solvers.rs | 1 - tig-worker/src/main.rs | 8 ++++---- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/tig-native-wrapper/src/dylib.rs b/tig-native-wrapper/src/dylib.rs index 939cecea..0b307e55 100644 --- a/tig-native-wrapper/src/dylib.rs +++ b/tig-native-wrapper/src/dylib.rs @@ -1,5 +1,5 @@ use { - libloading::{Library, Symbol}, + libloading::{Library}, std::path::Path, std::panic, }; @@ -14,9 +14,4 @@ pub fn load_module(path: &Path) -> Result Ok(lib_result) => lib_result.map_err(|e| e.to_string()), Err(_) => Err("Failed to load module".to_string()) } -} - -pub fn get_symbol<'lib, T>(lib: &'lib Library, name: &[u8]) -> Result, String> -{ - unsafe { lib.get(name).map_err(|e| e.to_string()) } -} +} \ No newline at end of file diff --git a/tig-native-wrapper/src/main.rs b/tig-native-wrapper/src/main.rs index 97f7ea15..07284be8 100644 --- a/tig-native-wrapper/src/main.rs +++ b/tig-native-wrapper/src/main.rs @@ -2,13 +2,11 @@ mod dylib; mod solvers; use { - std::path::Path, tig_challenges::{ - knapsack::{Challenge as KnapsackChallenge, Difficulty as KnapsackDifficulty}, - satisfiability::{Challenge as SatisfiabilityChallenge, Difficulty as SatisfiabilityDifficulty}, - vector_search::{Challenge as VectorSearchChallenge, Difficulty as VectorSearchDifficulty}, - vehicle_routing::{Challenge as VehicleRoutingChallenge, Difficulty as VehicleRoutingDifficulty}, - ChallengeTrait + knapsack::{Challenge as KnapsackChallenge}, + satisfiability::{Challenge as SatisfiabilityChallenge}, + vector_search::{Challenge as VectorSearchChallenge}, + vehicle_routing::{Challenge as VehicleRoutingChallenge}, }, }; diff --git a/tig-native-wrapper/src/solvers.rs b/tig-native-wrapper/src/solvers.rs index 813f2cda..5e98e0a1 100644 --- a/tig-native-wrapper/src/solvers.rs +++ b/tig-native-wrapper/src/solvers.rs @@ -5,7 +5,6 @@ use { satisfiability::{Challenge as SatisfiabilityChallenge, Solution as SatisfiabilitySolution}, vector_search::{Challenge as VectorSearchChallenge, Solution as VectorSearchSolution}, vehicle_routing::{Challenge as VehicleRoutingChallenge, Solution as VehicleRoutingSolution}, - ChallengeTrait }, crate::dylib::{load_module} }; diff --git a/tig-worker/src/main.rs b/tig-worker/src/main.rs index 78f3e20b..37e16e26 100644 --- a/tig-worker/src/main.rs +++ b/tig-worker/src/main.rs @@ -8,10 +8,10 @@ use tig_structs::core::*; use tig_utils::{compress_obj, dejsonify, jsonify, MerkleHash, MerkleTree}; use tig_worker::OutputData; use tokio::runtime::Runtime; -use tig_challenges::knapsack::{Challenge as KnapsackChallenge, Solution as KnapsackSolution}; -use tig_challenges::satisfiability::{Challenge as SatisfiabilityChallenge, Solution as SatisfiabilitySolution}; -use tig_challenges::vehicle_routing::{Challenge as VehicleRoutingChallenge, Solution as VehicleRoutingSolution}; -use tig_challenges::vector_search::{Challenge as VectorSearchChallenge, Solution as VectorSearchSolution}; +use tig_challenges::knapsack::{Challenge as KnapsackChallenge}; +use tig_challenges::satisfiability::{Challenge as SatisfiabilityChallenge}; +use tig_challenges::vehicle_routing::{Challenge as VehicleRoutingChallenge}; +use tig_challenges::vector_search::{Challenge as VectorSearchChallenge}; use tig_challenges::ChallengeTrait; fn cli() -> Command {