refactor(tvix/nix-compat/derivation): use writer.write_all
This is more concise than a io::copy of a Cursor to bytes, and we have everything to be written in memory. Change-Id: I81f34666aa61aef4e16b33423ce4a69c3781efc3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8997 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									737a6ca01e
								
							
						
					
					
						commit
						779fad29a1
					
				
					 2 changed files with 10 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -47,7 +47,7 @@ impl Derivation {
 | 
			
		|||
    ///
 | 
			
		||||
    /// The only errors returns are these when writing to the passed writer.
 | 
			
		||||
    pub fn serialize(&self, writer: &mut impl std::io::Write) -> Result<(), io::Error> {
 | 
			
		||||
        io::copy(&mut io::Cursor::new(write::DERIVATION_PREFIX), writer)?;
 | 
			
		||||
        writer.write_all(write::DERIVATION_PREFIX.as_bytes())?;
 | 
			
		||||
        write::write_char(writer, write::PAREN_OPEN)?;
 | 
			
		||||
 | 
			
		||||
        write::write_outputs(writer, &self.outputs)?;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue