core: Fix unused warnings in Nar

This commit is contained in:
Richard Marko 2023-11-16 07:05:05 +01:00
parent 3608451559
commit ef9fb46f89
2 changed files with 7 additions and 10 deletions

View File

@ -47,7 +47,7 @@ import qualified System.Nix.Internal.Nar.Options as Nar
-- of the actions the parser can take, and @ParserState@ for the -- of the actions the parser can take, and @ParserState@ for the
-- internals of the parser -- internals of the parser
newtype NarParser m a = NarParser newtype NarParser m a = NarParser
{ runNarParser :: { _runNarParser ::
State.StateT State.StateT
ParserState ParserState
(Except.ExceptT (Except.ExceptT
@ -554,15 +554,12 @@ testParser' :: (m ~ IO) => FilePath -> IO (Either String ())
testParser' fp = testParser' fp =
withFile fp ReadMode $ \h -> runParser Nar.narEffectsIO parseNar h "tmp" withFile fp ReadMode $ \h -> runParser Nar.narEffectsIO parseNar h "tmp"
-- | Distance to the next multiple of 8 -- | Distance to the next multiple of 8
padLen :: Int -> Int padLen :: Int -> Int
padLen n = (8 - n) `mod` 8 padLen n = (8 - n) `mod` 8
-- | Debugging helper
dbgState :: IO.MonadIO m => NarParser m () _dbgState :: IO.MonadIO m => NarParser m ()
dbgState = do _dbgState = do
s <- State.get s <- State.get
IO.liftIO $ print (tokenStack s, directoryStack s) IO.liftIO $ print (tokenStack s, directoryStack s)

View File

@ -561,16 +561,16 @@ sampleLinkToDirectoryBaseline = B64.decodeLenient $ BSL.concat
getBigFileSize :: IO Int64 getBigFileSize :: IO Int64
getBigFileSize = fromMaybe 5000000 . readMaybe <$> (getEnv "HNIX_BIG_FILE_SIZE" <|> pure "") getBigFileSize = fromMaybe 5000000 . readMaybe <$> (getEnv "HNIX_BIG_FILE_SIZE" <|> pure "")
-- TODO: implement and use in generator #232
-- | Add a link to a FileSystemObject. This is useful -- | Add a link to a FileSystemObject. This is useful
-- when creating Arbitrary FileSystemObjects. It -- when creating Arbitrary FileSystemObjects. It
-- isn't implemented yet -- isn't implemented yet
mkLink _mkLink
:: FilePath -- ^ Target :: FilePath -- ^ Target
-> FilePath -- ^ Link -> FilePath -- ^ Link
-> FileSystemObject -- ^ FileSystemObject to add link to -> FileSystemObject -- ^ FileSystemObject to add link to
-> FileSystemObject -> FileSystemObject
mkLink = undefined -- TODO _mkLink = undefined
mkBigFile :: FilePath -> IO () mkBigFile :: FilePath -> IO ()
mkBigFile path = do mkBigFile path = do