diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
commit | a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch) | |
tree | fc451898ccaf445814e26b46664d78702178101d /vendor/backtrace/tests | |
parent | Adding debian version 1.71.1+dfsg1-2. (diff) | |
download | rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/backtrace/tests')
-rw-r--r-- | vendor/backtrace/tests/current-exe-mismatch.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/vendor/backtrace/tests/current-exe-mismatch.rs b/vendor/backtrace/tests/current-exe-mismatch.rs index 21c67bcbf..b655827fb 100644 --- a/vendor/backtrace/tests/current-exe-mismatch.rs +++ b/vendor/backtrace/tests/current-exe-mismatch.rs @@ -118,11 +118,8 @@ fn find_interpreter(me: &Path) -> Result<PathBuf, EarlyExit> { let line = line?; let line = line.trim(); let prefix = "[Requesting program interpreter: "; - // This could use `line.split_once` and `suffix.rsplit_once` once the MSRV passes 1.52 - if let Some(idx) = line.find(prefix) { - let (_, suffix) = line.split_at(idx + prefix.len()); - if let Some(idx) = suffix.rfind("]") { - let (found_path, _ignore_remainder) = suffix.split_at(idx); + if let Some((_, suffix)) = line.split_once(prefix) { + if let Some((found_path, _)) = suffix.rsplit_once("]") { return Ok(found_path.into()); } } |