From 2fce356ce083bd8511421499ae9eeab77f358222 Mon Sep 17 00:00:00 2001 From: edef Date: Fri, 27 Oct 2023 16:05:32 +0000 Subject: fix(nix-compat/nar/writer): `use ByteSlice` closer to call site Otherwise, it'll generate unused import warnings in release mode. Change-Id: I0399d2617a8a8b973a2b8c18f4a0a613d70c48f5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9864 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/nix-compat/src/nar/writer/async.rs | 2 +- tvix/nix-compat/src/nar/writer/sync.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix') diff --git a/tvix/nix-compat/src/nar/writer/async.rs b/tvix/nix-compat/src/nar/writer/async.rs index dd5c72ac8913..11aefab9cba7 100644 --- a/tvix/nix-compat/src/nar/writer/async.rs +++ b/tvix/nix-compat/src/nar/writer/async.rs @@ -31,7 +31,6 @@ //! ``` use crate::nar::wire; -use bstr::ByteSlice; use futures_util::{AsyncBufRead, AsyncBufReadExt, AsyncWrite, AsyncWriteExt}; use std::{ io::{ @@ -197,6 +196,7 @@ impl<'a, 'w> Directory<'a, 'w> { Some(ref mut _prev_name) => { #[cfg(debug_assertions)] { + use bstr::ByteSlice; assert!( &**_prev_name < name, "misordered names: {:?} >= {:?}", diff --git a/tvix/nix-compat/src/nar/writer/sync.rs b/tvix/nix-compat/src/nar/writer/sync.rs index 071aab831c20..6270129028fa 100644 --- a/tvix/nix-compat/src/nar/writer/sync.rs +++ b/tvix/nix-compat/src/nar/writer/sync.rs @@ -29,7 +29,6 @@ //! ``` use crate::nar::wire; -use bstr::ByteSlice; use std::io::{ self, BufRead, ErrorKind::{InvalidInput, UnexpectedEof}, @@ -186,6 +185,7 @@ impl<'a, 'w> Directory<'a, 'w> { Some(ref mut _prev_name) => { #[cfg(debug_assertions)] { + use bstr::ByteSlice; assert!( &**_prev_name < name, "misordered names: {:?} >= {:?}", -- cgit 1.4.1