move CharGrid to own file
This commit is contained in:
		
							parent
							
								
									85a0ea0dc3
								
							
						
					
					
						commit
						01edc3dfcc
					
				
					 3 changed files with 9 additions and 4 deletions
				
			
		
							
								
								
									
										4
									
								
								crates/servicepoint/src/char_grid.rs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								crates/servicepoint/src/char_grid.rs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
use crate::PrimitiveGrid;
 | 
			
		||||
 | 
			
		||||
/// A grid containing UTF-8 characters.
 | 
			
		||||
pub type CharGrid = PrimitiveGrid<char>;
 | 
			
		||||
| 
						 | 
				
			
			@ -10,9 +10,6 @@ use std::collections::HashMap;
 | 
			
		|||
/// The encoding is currently not enforced.
 | 
			
		||||
pub type Cp437Grid = PrimitiveGrid<u8>;
 | 
			
		||||
 | 
			
		||||
/// A grid containing UTF-8 characters.
 | 
			
		||||
pub type CharGrid = PrimitiveGrid<char>;
 | 
			
		||||
 | 
			
		||||
/// Errors that can occur when loading CP-437.
 | 
			
		||||
#[derive(Debug, PartialEq)]
 | 
			
		||||
pub enum Cp437LoadError {
 | 
			
		||||
| 
						 | 
				
			
			@ -91,6 +88,7 @@ pub use feature_cp437::*;
 | 
			
		|||
 | 
			
		||||
#[cfg(feature = "cp437")]
 | 
			
		||||
mod feature_cp437 {
 | 
			
		||||
    use crate::CharGrid;
 | 
			
		||||
    use super::*;
 | 
			
		||||
 | 
			
		||||
    /// An array of 256 elements, mapping most of the CP437 values to UTF-8 characters
 | 
			
		||||
| 
						 | 
				
			
			@ -248,6 +246,7 @@ mod tests {
 | 
			
		|||
#[cfg(test)]
 | 
			
		||||
#[cfg(feature = "cp437")]
 | 
			
		||||
mod tests_feature_cp437 {
 | 
			
		||||
    use crate::CharGrid;
 | 
			
		||||
    use super::*;
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,10 +41,11 @@ pub use bitvec;
 | 
			
		|||
 | 
			
		||||
pub use crate::bitmap::Bitmap;
 | 
			
		||||
pub use crate::brightness::{Brightness, BrightnessGrid};
 | 
			
		||||
pub use crate::char_grid::CharGrid;
 | 
			
		||||
pub use crate::command::{Command, Offset};
 | 
			
		||||
pub use crate::compression_code::CompressionCode;
 | 
			
		||||
pub use crate::connection::Connection;
 | 
			
		||||
pub use crate::cp437::{CharGrid, Cp437Grid};
 | 
			
		||||
pub use crate::cp437::Cp437Grid;
 | 
			
		||||
pub use crate::data_ref::DataRef;
 | 
			
		||||
pub use crate::grid::Grid;
 | 
			
		||||
pub use crate::origin::{Origin, Pixels, Tiles};
 | 
			
		||||
| 
						 | 
				
			
			@ -55,6 +56,7 @@ pub type BitVec = bitvec::prelude::BitVec<u8, bitvec::prelude::Msb0>;
 | 
			
		|||
 | 
			
		||||
mod bitmap;
 | 
			
		||||
mod brightness;
 | 
			
		||||
mod char_grid;
 | 
			
		||||
mod command;
 | 
			
		||||
mod command_code;
 | 
			
		||||
mod compression;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue