Skip to content

Commit bd7bdcb

Browse files
oriongonzaOrionGonzalezbonigarcia
authored
scrapped refactors from old PR (#11907)
* scrapped refactors from old PR * Revert str_to_os --------- Co-authored-by: ogonzalez <[email protected]> Co-authored-by: Boni García <[email protected]>
1 parent facb8ca commit bd7bdcb

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

rust/src/config.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,6 @@ impl ManagerConfig {
8888
driver_ttl: IntegerKey("driver-ttl", TTL_DRIVERS_SEC).get_value(),
8989
}
9090
}
91-
92-
#[allow(clippy::should_implement_trait)]
93-
pub fn clone(config: &ManagerConfig) -> ManagerConfig {
94-
ManagerConfig {
95-
browser_version: config.browser_version.as_str().to_string(),
96-
driver_version: config.driver_version.as_str().to_string(),
97-
os: config.os.as_str().to_string(),
98-
arch: config.arch.as_str().to_string(),
99-
browser_path: config.browser_path.as_str().to_string(),
100-
proxy: config.proxy.as_str().to_string(),
101-
timeout: config.timeout,
102-
browser_ttl: config.browser_ttl,
103-
driver_ttl: config.driver_ttl,
104-
}
105-
}
10691
}
10792

10893
#[allow(dead_code)]

rust/src/files.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ pub fn create_path_if_not_exists(path: &Path) {
6060
}
6161

6262
pub fn uncompress(
63-
compressed_file: &String,
64-
target: PathBuf,
63+
compressed_file: &str,
64+
target: &PathBuf,
6565
log: &Logger,
6666
) -> Result<(), Box<dyn Error>> {
6767
let file = File::open(compressed_file)?;
@@ -89,7 +89,7 @@ pub fn uncompress(
8989
Ok(())
9090
}
9191

92-
pub fn untargz(file: File, target: PathBuf, log: &Logger) -> Result<(), Box<dyn Error>> {
92+
pub fn untargz(file: File, target: &PathBuf, log: &Logger) -> Result<(), Box<dyn Error>> {
9393
log.trace(format!("Untargz file to {}", target.display()));
9494
let tar = GzDecoder::new(&file);
9595
let mut archive = Archive::new(tar);
@@ -102,7 +102,7 @@ pub fn untargz(file: File, target: PathBuf, log: &Logger) -> Result<(), Box<dyn
102102
Ok(())
103103
}
104104

105-
pub fn unzip(file: File, target: PathBuf, log: &Logger) -> Result<(), Box<dyn Error>> {
105+
pub fn unzip(file: File, target: &Path, log: &Logger) -> Result<(), Box<dyn Error>> {
106106
log.trace(format!("Unzipping file to {}", target.display()));
107107
let mut archive = ZipArchive::new(file)?;
108108

rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub trait SeleniumManager {
131131
let (_tmp_folder, driver_zip_file) =
132132
download_driver_to_tmp_folder(self.get_http_client(), driver_url, self.get_logger())?;
133133
let driver_path_in_cache = Self::get_driver_path_in_cache(self);
134-
uncompress(&driver_zip_file, driver_path_in_cache, self.get_logger())
134+
uncompress(&driver_zip_file, &driver_path_in_cache, self.get_logger())
135135
}
136136

137137
fn detect_browser_path(&self) -> Option<&str> {

0 commit comments

Comments
 (0)