Create dedicated is_*_enabled functions for each preview style (#8988)

This commit is contained in:
Micha Reiser 2023-12-04 14:38:54 +09:00 committed by GitHub
parent 7e390d3772
commit 0bda1913d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 11 deletions

View file

@ -74,6 +74,11 @@ impl<'a> PyFormatContext<'a> {
..self
}
}
/// Returns `true` if preview mode is enabled.
pub(crate) const fn is_preview(&self) -> bool {
self.options.preview().is_enabled()
}
}
impl FormatContext for PyFormatContext<'_> {