1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00
nix/src
John Ericson 0f0d9255c6 Clean up JSON utils in a few ways
In particular

- Remove `get`, it is redundant with `valueAt` and the `get` in
  `util.hh`.

- Remove `nullableValueAt`. It is morally just the function composition
  `getNullable . valueAt`, not an orthogonal combinator like the others.

- `optionalValueAt` return a pointer, not `std::optional`. This also
  expresses optionality, but without creating a needless copy. This
  brings it in line with the other combinators which also return
  references.

- Delete `valueAt` and `optionalValueAt` taking the map by value, as we
  did for `get` in 408c09a120, which
  prevents bugs / unnecessary copies.

`adl_serializer<DerivationOptions::OutputChecks>::from_json` was the one
use of `getNullable`. I give it a little static function for the
ultimate creation of a `std::optional` it does need to do (after
switching it to using `getNullable . valueAt`. That could go in
`json-utils.hh` eventually, but I didn't bother for now since only one
things needs it.

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
2025-10-25 14:49:51 -04:00
..
external-api-docs meson: Apply formatting universally 2025-08-07 02:58:29 +03:00
internal-api-docs meson: Apply formatting universally 2025-08-07 02:58:29 +03:00
json-schema-checks JSON Schema for DerivedPath 2025-10-24 12:08:00 -04:00
libcmd Factor out --no-check-sigs 2025-10-16 16:35:09 +02:00
libexpr Allow access to the result of fetchClosure 2025-10-24 11:11:03 +02:00
libexpr-c meson: Move asan-options to common 2025-10-11 16:08:35 +03:00
libexpr-test-support meson: Move asan-options to common 2025-10-11 16:08:35 +03:00
libexpr-tests meson: Simplify asan-options handling even more 2025-10-12 19:16:06 +03:00
libfetchers Clean up JSON utils in a few ways 2025-10-25 14:49:51 -04:00
libfetchers-c meson: Move asan-options to common 2025-10-11 16:08:35 +03:00
libfetchers-tests libfetchers/git-utils: Be more correct about validating refnames 2025-10-15 21:54:09 +03:00
libflake Clarify unlocked input warning message 2025-10-19 14:08:34 +02:00
libflake-c meson: Move asan-options to common 2025-10-11 16:08:35 +03:00
libflake-tests Remove unecessary includes 2025-10-14 23:48:45 -04:00
libmain Revert "libmain: Catch logger exceptions in handleExceptions" 2025-10-23 23:49:41 +03:00
libmain-c meson: Move asan-options to common 2025-10-11 16:08:35 +03:00
libstore Clean up JSON utils in a few ways 2025-10-25 14:49:51 -04:00
libstore-c Merge remote-tracking branch 'upstream/master' into upstream-RossComputerGuy/feat/expose-computefsclosure 2025-10-15 15:40:10 +02:00
libstore-test-support meson: Move asan-options to common 2025-10-11 16:08:35 +03:00
libstore-tests feat(libstore): support S3 object versioning via versionId parameter 2025-10-25 07:57:58 +00:00
libutil Clean up JSON utils in a few ways 2025-10-25 14:49:51 -04:00
libutil-c meson: Move asan-options to common 2025-10-11 16:08:35 +03:00
libutil-test-support Allow for standard nlohmann JSON serializers to take separate XP features 2025-10-16 16:45:22 -04:00
libutil-tests Clean up JSON utils in a few ways 2025-10-25 14:49:51 -04:00
nix Merge pull request #14296 from lovesegfault/nix-s3-more-tests 2025-10-20 19:42:22 +00:00
perl Convert Realisation JSON logic to standard style 2025-09-22 12:59:37 -04:00
nix-functional-tests Build Functional tests with Meson 2024-08-14 15:35:40 -04:00
nix-manual Build the manual with Meson 2024-10-09 11:58:17 -04:00