chore: not completed

This commit is contained in:
2020-07-19 17:49:08 +08:00
parent aa145d6912
commit 2085babe94

View File

@@ -1,3 +1,33 @@
fn main() {
println!("Hello, world!");
// println!("{}", parse_color("hello world"));
}
enum Block {
String(String),
Bold,
Under,
Color(String),
TrueColor(u8, u8, u8),
EndAll,
EndBold,
EndUnder,
EndColor,
}
/// <red></red>
/// <red><bold></>
/// \\ \<
fn parse_color(msg: &str) -> Vec<Block> {
let mut parsed_blocks = vec![];
let mut msg_iter = msg.chars().peekable();
while let Some(c) = msg_iter.next() {
if c == '\\' {
// match msg_iter.next() {
// Some(c) => parsed_blocks.push(c), None => break,
// }
}
}
parsed_blocks
}