diff options
Diffstat (limited to 'vendor/chalk-solve-0.87.0/src/display/render_trait.rs')
-rw-r--r-- | vendor/chalk-solve-0.87.0/src/display/render_trait.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/vendor/chalk-solve-0.87.0/src/display/render_trait.rs b/vendor/chalk-solve-0.87.0/src/display/render_trait.rs deleted file mode 100644 index a565f076c..000000000 --- a/vendor/chalk-solve-0.87.0/src/display/render_trait.rs +++ /dev/null @@ -1,30 +0,0 @@ -//! `RenderAsRust` trait and related utils. -use std::fmt::{Display, Formatter, Result}; - -use chalk_ir::interner::Interner; - -use super::state::InternalWriterState; - -/// Displays `RenderAsRust` data. -/// -/// This is a utility struct for making `RenderAsRust` nice to use with rust format macros. -pub(in crate::display) struct DisplayRenderAsRust<'a, I: Interner, T> { - s: &'a InternalWriterState<'a, I>, - rar: &'a T, -} - -impl<I: Interner, T: RenderAsRust<I>> Display for DisplayRenderAsRust<'_, I, T> { - fn fmt(&self, f: &mut Formatter<'_>) -> Result { - self.rar.fmt(self.s, f) - } -} - -pub(in crate::display) trait RenderAsRust<I: Interner> { - fn fmt(&self, s: &InternalWriterState<'_, I>, f: &mut Formatter<'_>) -> Result; - fn display<'a>(&'a self, s: &'a InternalWriterState<'a, I>) -> DisplayRenderAsRust<'a, I, Self> - where - Self: Sized, - { - DisplayRenderAsRust { s, rar: self } - } -} |