rebased to use custom struct over String

This commit is contained in:
djaidjai committed 2023-02-08 17:24:17 +01:00
1 parent b00ef93c1c
commit 135274c9c5
4 files changed
+53 -26

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
pub struct RGB {
pub r: u8,
pub g: u8,
pub b: u8,
}
pub struct Ascii {
pub char: char,
pub rgb: RGB,
}
impl Ascii {
fn _new(char: char, r: u8, g: u8, b: u8) -> Self {
Ascii {
char,
rgb: RGB {
r,
g,
b,
},
}
}
pub fn new(ch: u8, r: u8, g: u8, b: u8) -> Self {
Self::_new(char::from(ch), r, g, b)
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.