Skip to content

Commit

Permalink
[rust] Fix problems after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Oct 6, 2023
1 parent 514b29f commit 2cf7a07
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rust/src/chrome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::path::PathBuf;
use crate::config::ARCH::{ARM64, X32};
use crate::config::OS::{LINUX, MACOS, WINDOWS};
use crate::downloads::{parse_json_from_url, read_version_from_link};
use crate::files::{compose_driver_path_in_cache, path_to_string, BrowserPath};
use crate::files::{compose_driver_path_in_cache, BrowserPath};
use crate::logger::Logger;
use crate::metadata::{
create_driver_metadata, get_driver_version_from_metadata, get_metadata, write_metadata,
Expand Down
4 changes: 2 additions & 2 deletions rust/src/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::metadata::{
create_driver_metadata, get_driver_version_from_metadata, get_metadata, write_metadata,
};
use crate::{
create_http_client, get_binary_extension, path_buf_to_string, Logger, SeleniumManager, BETA,
create_http_client, get_binary_extension, path_to_string, Logger, SeleniumManager, BETA,
DASH_DASH_VERSION, DEV, ENV_PROGRAM_FILES_X86, NIGHTLY, OFFLINE_REQUEST_ERR_MSG,
REG_VERSION_ARG, STABLE,
};
Expand Down Expand Up @@ -448,7 +448,7 @@ impl SeleniumManager for EdgeManager {
let parent_path = Path::new(&env_value);
full_browser_path = parent_path.join(&browser_path);
}
Ok((&path_buf_to_string(full_browser_path)).into())
Ok((&path_to_string(&full_browser_path)).into())
} else {
Ok(browser_in_cache.join(format!(
"{}{}",
Expand Down
4 changes: 2 additions & 2 deletions rust/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ pub fn uncompress_deb(
let mut deb_pkg = debpkg::DebPkg::parse(deb_file)?;
deb_pkg.data()?.unpack(zip_parent)?;

let zip_parent_str = path_buf_to_string(zip_parent.to_path_buf());
let target_str = path_buf_to_string(target.to_path_buf());
let zip_parent_str = path_to_string(zip_parent);
let target_str = path_to_string(target);
let opt_edge_str = format!("{}/opt/microsoft/{}", zip_parent_str, label);
log.trace(format!(
"Moving extracted files and folders from {} to {}",
Expand Down
9 changes: 5 additions & 4 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::chrome::{ChromeManager, CHROMEDRIVER_NAME, CHROME_NAME};
use crate::edge::{EdgeManager, EDGEDRIVER_NAME, EDGE_NAMES};
use crate::files::{
create_parent_path_if_not_exists, create_path_if_not_exists, default_cache_folder,
get_binary_extension, path_buf_to_string,
get_binary_extension, path_to_string,
};
use crate::firefox::{FirefoxManager, FIREFOX_NAME, GECKODRIVER_NAME};
use crate::iexplorer::{IExplorerManager, IEDRIVER_NAME, IE_NAMES};
Expand Down Expand Up @@ -218,7 +218,8 @@ pub trait SeleniumManager {

let browser_version;
let original_browser_version = self.get_config().browser_version.clone();
let mut metadata = get_metadata(self.get_logger(), self.get_cache_path()?);
let cache_path = self.get_cache_path()?;
let mut metadata = get_metadata(self.get_logger(), &cache_path);
let major_browser_version = self.get_major_browser_version();
let major_browser_version_int = major_browser_version.parse::<i32>().unwrap_or_default();

Expand Down Expand Up @@ -274,7 +275,7 @@ pub trait SeleniumManager {
&browser_version,
browser_ttl,
));
write_metadata(&metadata, self.get_logger(), self.get_cache_path()?);
write_metadata(&metadata, self.get_logger(), cache_path);
}
}
}
Expand Down Expand Up @@ -321,7 +322,7 @@ pub trait SeleniumManager {
)?;
}
if browser_binary_path.exists() {
self.set_browser_path(path_buf_to_string(browser_binary_path.clone()));
self.set_browser_path(path_to_string(&browser_binary_path));
Ok(Some(browser_binary_path))
} else {
self.get_logger().warn(format!(
Expand Down

0 comments on commit 2cf7a07

Please sign in to comment.