Use .rsplit_once("/src/") instead of .split_once("/src/").

This commit is contained in:
Eduard-Mihai Burtescu 2023-04-21 21:34:59 +03:00 committed by Eduard-Mihai Burtescu
parent f559a6b16e
commit 7e402553bc

View File

@ -332,7 +332,7 @@ impl DiagnosticReporter<'_> {
let prefix = match level {
DiagLevel::Bug(location) => {
let location = location.to_string();
let location = match location.split_once("/src/") {
let location = match location.rsplit_once("/src/") {
Some((_path_prefix, intra_src)) => intra_src,
None => &location,
};