Skip to content

Commit 8e84f0d

Browse files
authored
[rust] Set Rust version to 1.89.0 in WORKSPACE (#16368)
1 parent 6061c87 commit 8e84f0d

File tree

6 files changed

+40
-43
lines changed

6 files changed

+40
-43
lines changed

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_regi
3434

3535
rules_rust_dependencies()
3636

37-
rust_register_toolchains()
37+
rust_register_toolchains(versions = ["1.89.0"])
3838

3939
load("@rules_rust//crate_universe:defs.bzl", "crates_repository")
4040

rust/Cargo.Bazel.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"checksum": "056872abd60303d8bce1e1a3108b098a6cb83bb21ce94a6c490cd177ed62b0dd",
2+
"checksum": "638f6b3fe087406f8a272d384acf810030eab5b2e6cfb75c7ec6df0aafe69644",
33
"crates": {
44
"addr2line 0.25.1": {
55
"name": "addr2line",

rust/src/downloads.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub async fn download_to_tmp_folder(
5353
let target_name = response
5454
.url()
5555
.path_segments()
56-
.and_then(|segments| segments.last())
56+
.and_then(|mut segments| segments.next_back())
5757
.and_then(|name| if name.is_empty() { None } else { Some(name) })
5858
.unwrap_or("tmp.bin");
5959

rust/src/lib.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -624,17 +624,16 @@ pub trait SeleniumManager {
624624
if let Some(path) = browser_path {
625625
self.get_logger()
626626
.debug(format!("Found {} in PATH: {}", browser_name, &path));
627-
if self.is_snap(&path) {
628-
if let Some(snap_path) = self.get_snap_path() {
629-
if snap_path.exists() {
630-
self.get_logger().debug(format!(
631-
"Using {} snap: {}",
632-
browser_name,
633-
path_to_string(snap_path.as_path())
634-
));
635-
return Some(snap_path);
636-
}
637-
}
627+
if self.is_snap(&path)
628+
&& let Some(snap_path) = self.get_snap_path()
629+
&& snap_path.exists()
630+
{
631+
self.get_logger().debug(format!(
632+
"Using {} snap: {}",
633+
browser_name,
634+
path_to_string(snap_path.as_path())
635+
));
636+
return Some(snap_path);
638637
}
639638
return Some(Path::new(&path).to_path_buf());
640639
}

rust/src/lock.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@ impl Lock {
7070
}
7171

7272
pub fn clear_lock_if_required() {
73-
let lock_path = get_lock_path();
74-
if lock_path.is_some() {
75-
let lock = lock_path.unwrap();
76-
if lock.exists() {
77-
fs::remove_file(lock).unwrap_or_default();
78-
}
73+
if let Some(lock) = get_lock_path()
74+
&& lock.exists()
75+
{
76+
fs::remove_file(lock).unwrap_or_default();
7977
}
8078
}
8179

rust/src/main.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -254,35 +254,35 @@ fn main() {
254254
})
255255
.unwrap_or_else(|err| {
256256
let log = selenium_manager.get_logger();
257-
if selenium_manager.is_fallback_driver_from_cache() {
258-
if let Some(best_driver_from_cache) =
257+
if selenium_manager.is_fallback_driver_from_cache()
258+
&& let Some(best_driver_from_cache) =
259259
selenium_manager.find_best_driver_from_cache().unwrap()
260-
{
261-
log.debug_or_warn(
262-
format!(
263-
"There was an error managing {} ({}); using driver found in the cache",
264-
selenium_manager.get_driver_name(),
265-
err
266-
),
267-
selenium_manager.is_offline(),
268-
);
269-
log_driver_and_browser_path(
270-
log,
271-
&best_driver_from_cache,
272-
&selenium_manager.get_browser_path_or_latest_from_cache(),
273-
selenium_manager.get_receiver(),
274-
);
275-
flush_and_exit(OK, log, Some(err));
276-
}
260+
{
261+
log.debug_or_warn(
262+
format!(
263+
"There was an error managing {} ({}); using driver found in the cache",
264+
selenium_manager.get_driver_name(),
265+
err
266+
),
267+
selenium_manager.is_offline(),
268+
);
269+
log_driver_and_browser_path(
270+
log,
271+
&best_driver_from_cache,
272+
&selenium_manager.get_browser_path_or_latest_from_cache(),
273+
selenium_manager.get_receiver(),
274+
);
275+
flush_and_exit(OK, log, Some(err));
277276
}
278277
if selenium_manager.is_offline() {
279278
log.warn(&err);
280279
flush_and_exit(OK, log, Some(err));
281280
} else {
282-
let error_msg = log
283-
.is_debug_enabled()
284-
.then(|| format!("{:?}", err))
285-
.unwrap_or_else(|| err.to_string());
281+
let error_msg = if log.is_debug_enabled() {
282+
format!("{:?}", err)
283+
} else {
284+
err.to_string()
285+
};
286286
log.error(error_msg);
287287
flush_and_exit(DATAERR, log, Some(err));
288288
}

0 commit comments

Comments
 (0)