Alyssa Ross 81e1e68eaf lib.trivial.warnIf: init
It's a common pattern in Nixpkgs to want to emit a warning in certain
cases, but not actually change behaviours.

This is often expressed as either
	if cond then lib.warn "Don't do that thing" x else x
Or
	(if cond then lib.warn "Don't do that thing" else lib.id) x

Neither of which really expresses the intent here, because it looks
like 'x' is being chosen conditionally.

To make this clearer, I introduce a "warnIf" function, which makes it
clear that the only thing being affected by the condition is whether
the warning is generated, not the value being returned.
2021-04-28 21:44:21 +00:00
..
2021-04-23 22:23:25 +00:00
2021-01-25 19:25:50 +01:00
2021-04-28 21:44:21 +00:00
2017-09-16 21:36:43 -04:00
2021-04-01 14:29:57 +02:00
2018-11-22 08:59:48 +00:00
2020-06-04 13:43:10 +02:00
2021-04-28 21:44:21 +00:00
2019-09-26 17:42:42 +02:00