query
On this page

unsafeDiscardStringContext

lib.strings.unsafeDiscardStringContext

Primop
Docs pulled from | This Revision | 12 minutes ago


Nix manual

Takes 1 arguments

s

Discard the string context from a value that can be coerced to a string.

Noogle detected

Aliases

Implementation

This function is implemented in c++ and is part of the native nix runtime.

src/libexpr/primops/context.cc:9

static void prim_unsafeDiscardStringContext(EvalState & state, const PosIdx pos, Value ** args, Value & v)
{
    NixStringContext context;
    auto s = state.coerceToString(
        pos, *args[0], context, "while evaluating the argument passed to builtins.unsafeDiscardStringContext");
    v.mkString(*s, state.mem);
}

Implementation

The following is the current implementation of this function.

unsafeDiscardStringContext