diff options
| author | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2023-02-02 12:25:44 +0100 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2023-02-02 12:25:44 +0100 |
| commit | 55cb7ec5d595a480c906070e97fb2a604e73ab64 (patch) | |
| tree | 8e317f019ab24e1c035e9e70f0bb94307bd15486 | |
| parent | 4d4421f9194b755cd7f0ee16cad076562c03bea5 (diff) | |
| download | rabbitmq-server-git-55cb7ec5d595a480c906070e97fb2a604e73ab64.tar.gz | |
rabbit_feature_flags: Fix spec and doc of `get_stability/1'
The return value was incorrectly specified and documented: it can return
`undefined` when a feature flag name is passed and that feature flag is
unknown.
So far, this function is always called with a feature flag properties
map, in which case it doesn't return `undefined`.
| -rw-r--r-- | deps/rabbit/src/rabbit_feature_flags.erl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/deps/rabbit/src/rabbit_feature_flags.erl b/deps/rabbit/src/rabbit_feature_flags.erl index 6d5ed9497b..e2c969f937 100644 --- a/deps/rabbit/src/rabbit_feature_flags.erl +++ b/deps/rabbit/src/rabbit_feature_flags.erl @@ -682,7 +682,13 @@ get_state(FeatureName) when is_atom(FeatureName) -> end end. --spec get_stability(feature_name() | feature_props_extended()) -> stability(). +-spec get_stability +(FeatureName) -> Stability | undefined when + FeatureName :: feature_name(), + Stability :: stability(); +(FeatureProps) -> Stability when + FeatureProps :: feature_props_extended(), + Stability :: stability(). %% @doc %% Returns the stability of a feature flag. %% @@ -696,12 +702,12 @@ get_state(FeatureName) when is_atom(FeatureName) -> %% <li>`experimental': the feature flag is experimental and may change in %% the future (without a guaranteed upgrade path): enabling it in %% production is not recommended.</li> -%% <li>`unavailable': the feature flag is unsupported by at least one -%% node in the cluster and can not be enabled for now.</li> %% </ul> %% %% @param FeatureName The name of the feature flag to check. -%% @returns `stable' or `experimental'. +%% @param FeatureProps A feature flag properties map. +%% @returns `required', `stable' or `experimental', or `undefined' if the +%% given feature flag name doesn't correspond to a known feature flag. get_stability(FeatureName) when is_atom(FeatureName) -> case rabbit_ff_registry:get(FeatureName) of |
