Format bytes string (#6166)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Format bytes string Closes #6064 ## Test Plan Added a fixture based on string's one
This commit is contained in:
@@ -31,7 +31,7 @@ pub enum StringLayout {
|
||||
|
||||
impl<'a> FormatString<'a> {
|
||||
pub(super) fn new(constant: &'a ExprConstant) -> Self {
|
||||
debug_assert!(constant.value.is_str());
|
||||
debug_assert!(constant.value.is_str() || constant.value.is_bytes());
|
||||
Self {
|
||||
constant,
|
||||
layout: StringLayout::Default,
|
||||
@@ -70,7 +70,7 @@ struct FormatStringContinuation<'a> {
|
||||
|
||||
impl<'a> FormatStringContinuation<'a> {
|
||||
fn new(constant: &'a ExprConstant) -> Self {
|
||||
debug_assert!(constant.value.is_str());
|
||||
debug_assert!(constant.value.is_str() || constant.value.is_bytes());
|
||||
Self { constant }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user