diff options
Diffstat (limited to 'tvix/nix-compat/src/nar/writer')
-rw-r--r-- | tvix/nix-compat/src/nar/writer/async.rs | 3 | ||||
-rw-r--r-- | tvix/nix-compat/src/nar/writer/sync.rs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/tvix/nix-compat/src/nar/writer/async.rs b/tvix/nix-compat/src/nar/writer/async.rs index 2b73e56737ce..dd5c72ac8913 100644 --- a/tvix/nix-compat/src/nar/writer/async.rs +++ b/tvix/nix-compat/src/nar/writer/async.rs @@ -203,8 +203,7 @@ impl<'a, 'w> Directory<'a, 'w> { _prev_name.as_bstr(), name.as_bstr() ); - _prev_name.clear(); - _prev_name.extend_from_slice(name); + name.clone_into(_prev_name); } self.node.write(&wire::TOK_PAR).await?; } diff --git a/tvix/nix-compat/src/nar/writer/sync.rs b/tvix/nix-compat/src/nar/writer/sync.rs index 9290e4a5bdfe..071aab831c20 100644 --- a/tvix/nix-compat/src/nar/writer/sync.rs +++ b/tvix/nix-compat/src/nar/writer/sync.rs @@ -192,8 +192,7 @@ impl<'a, 'w> Directory<'a, 'w> { _prev_name.as_bstr(), name.as_bstr() ); - _prev_name.clear(); - _prev_name.extend_from_slice(name); + name.clone_into(_prev_name); } self.node.write(&wire::TOK_PAR)?; } |