Completed sender removal.
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/field.rs
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/field.rs
									
									
									
									
									
								
							@@ -6,16 +6,6 @@ use uuid::Uuid;
 | 
			
		||||
pub enum Field {
 | 
			
		||||
    Static(String),
 | 
			
		||||
    Uuid(Uuid),
 | 
			
		||||
    Tx(Sender<Message>),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl Field {
 | 
			
		||||
    pub fn to_sender(&self) -> Result<Sender<Message>, String> {
 | 
			
		||||
        match self {
 | 
			
		||||
            Field::Tx(sender) => Ok(sender.clone()),
 | 
			
		||||
            _ => Err("not a sender field".to_string()),
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl From<String> for Field {
 | 
			
		||||
@@ -49,7 +39,6 @@ impl fmt::Display for Field {
 | 
			
		||||
        match self {
 | 
			
		||||
            Field::Uuid(data) => write!(f, "{}", data),
 | 
			
		||||
            Field::Static(data) => write!(f, "{}", data),
 | 
			
		||||
            Field::Tx(_) => write!(f, "{}", "message sender"),
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user