mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-16 15:38:48 +00:00
Initial commit
This commit is contained in:
18
src/write_base.rs
Normal file
18
src/write_base.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use std::io::{Result, Write};
|
||||
|
||||
#[inline]
|
||||
pub fn write_indent(indent: usize, write: &mut dyn Write) -> Result<()> {
|
||||
write!(write, "{}", " ".repeat(indent))
|
||||
}
|
||||
|
||||
pub trait WriteLine {
|
||||
fn write_line(&self, indent: usize, write: &mut dyn Write) -> Result<()>;
|
||||
}
|
||||
|
||||
pub trait WriteString {
|
||||
fn write_string(&self) -> String;
|
||||
}
|
||||
|
||||
pub trait WriteOp {
|
||||
fn write_operation(&self) -> String;
|
||||
}
|
||||
Reference in New Issue
Block a user