Skip to main content

oxilean_runtime/string_pool/
rope_traits.rs

1//! # Rope - Trait Implementations
2//!
3//! This module contains trait implementations for `Rope`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Default`
8//! - `Display`
9//!
10//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
11
12use super::functions::rope_fmt;
13use super::types::Rope;
14use std::fmt;
15
16impl Default for Rope {
17    fn default() -> Self {
18        Self::new()
19    }
20}
21
22impl fmt::Display for Rope {
23    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
24        if let Some(node) = &self.root {
25            rope_fmt(node, f)
26        } else {
27            Ok(())
28        }
29    }
30}