forked from proxmox-mirrors/proxmox
		
	compression: limit ZstdEncoder constructors to usable ones
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
		
							parent
							
								
									79ac8d7344
								
							
						
					
					
						commit
						f8fe8f59a6
					
				@ -32,7 +32,11 @@ pub struct ZstdEncoder<'a, T> {
 | 
			
		||||
    state: EncoderState,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl<'a, T> ZstdEncoder<'a, T> {
 | 
			
		||||
impl<'a, T, O> ZstdEncoder<'a, T>
 | 
			
		||||
where
 | 
			
		||||
    T: Stream<Item = Result<O, Error>> + Unpin,
 | 
			
		||||
    O: Into<Bytes>,
 | 
			
		||||
{
 | 
			
		||||
    /// Returns a new [ZstdEncoder] with default level 3
 | 
			
		||||
    pub fn new(inner: T) -> Result<Self, io::Error> {
 | 
			
		||||
        Self::with_quality(inner, 3)
 | 
			
		||||
@ -48,7 +52,9 @@ impl<'a, T> ZstdEncoder<'a, T> {
 | 
			
		||||
            state: EncoderState::Reading,
 | 
			
		||||
        })
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl<'a, T> ZstdEncoder<'a, T> {
 | 
			
		||||
    /// Returns the wrapped [Stream]
 | 
			
		||||
    pub fn into_inner(self) -> T {
 | 
			
		||||
        self.inner
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user