turn room format and room type into enums; transform line endings
This commit is contained in:
12
src/lib.rs
12
src/lib.rs
@@ -1,4 +1,8 @@
|
||||
extern crate loe;
|
||||
|
||||
use std::io::Cursor;
|
||||
use radix_fmt::radix_36;
|
||||
use loe::{process, Config, TransformMode};
|
||||
|
||||
pub mod avatar;
|
||||
pub mod colour;
|
||||
@@ -96,6 +100,14 @@ fn optional_data_line<T: Display>(label: &str, item: Option<T>) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
fn transform_line_endings(input: String, mode: TransformMode) -> String {
|
||||
let mut input = Cursor::new(input);
|
||||
let mut output = Cursor::new(Vec::new());
|
||||
|
||||
process(&mut input, &mut output, Config::default().transform(mode)).unwrap();
|
||||
String::from_utf8(output.into_inner()).unwrap()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{from_base36, ToBase36, optional_data_line, mock};
|
||||
|
||||
Reference in New Issue
Block a user