refactor(nix-compat/nar/writer): use clone_into
Equivalent to the existing code, but a little less cryptic. Change-Id: Ib9b2f9aedddc84d0e79840bba4cce01f92d9bc56 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9766 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
parent
6638f4d4ea
commit
2cae6a02b9
2 changed files with 2 additions and 4 deletions
|
@ -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?;
|
||||
}
|
||||
|
|
|
@ -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)?;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue