···16161717 A string pattern can only match on a literal string prefix.
18181919- Matching on a literal suffix is not possible, because `infix` would have an unknown size.
1919+ Matching on a literal suffix is not possible, because `infix` would have an
2020+ unknown size.
2021 ```
21222223 ([Gavin Morrow](https://github.com/gavinmorrow))
···11use crate::ast::{SrcSpan, TypeAst};
22use crate::diagnostic::{ExtraLabel, Label};
33-use crate::error::wrap;
33+use crate::error::{wrap, wrap_format};
44use crate::parse::Token;
55use ecow::EcoString;
66use itertools::Itertools;
···559559 extra_labels: vec![],
560560 },
561561562562- ParseErrorType::ConcatPatternVariableWithSuffix { name}=> ParseErrorDetails {
562562+ ParseErrorType::ConcatPatternVariableWithSuffix { name } => ParseErrorDetails {
563563 text: [
564564 "A string pattern can only match on a literal string prefix.",
565565 "",
566566- &format!("Matching on a literal suffix is not possible, because `{}` would have an unknown size.", name),
566566+ &wrap_format!(
567567+ "Matching on a literal suffix is not possible, because `{name}` \
568568+would have an unknown size."
569569+ ),
567570 ]
568571 .join("\n"),
569572 hint: None,
···16161717A string pattern can only match on a literal string prefix.
18181919-Matching on a literal suffix is not possible, because `infix` would have an unknown size.
1919+Matching on a literal suffix is not possible, because `infix` would have an
2020+unknown size.
···16161717A string pattern can only match on a literal string prefix.
18181919-Matching on a literal suffix is not possible, because `_` would have an unknown size.
1919+Matching on a literal suffix is not possible, because `_` would have an
2020+unknown size.
···16161717A string pattern can only match on a literal string prefix.
18181919-Matching on a literal suffix is not possible, because `wibble` would have an unknown size.
1919+Matching on a literal suffix is not possible, because `wibble` would have
2020+an unknown size.