Skip to main content

oxilean_codegen/futhark_backend/
futharkletbinding_traits.rs

1//! # FutharkLetBinding - Trait Implementations
2//!
3//! This module contains trait implementations for `FutharkLetBinding`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::FutharkLetBinding;
12use std::fmt;
13
14impl std::fmt::Display for FutharkLetBinding {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        if let Some(ty) = &self.type_ann {
17            write!(
18                f,
19                "let ({}: {}) = {} in\n{}",
20                self.pattern, ty, self.value, self.body
21            )
22        } else {
23            write!(f, "let {} = {} in\n{}", self.pattern, self.value, self.body)
24        }
25    }
26}