Skip to content

Commit 55cb7ec

Browse files
committed
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`.
1 parent 4d4421f commit 55cb7ec

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

deps/rabbit/src/rabbit_feature_flags.erl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,13 @@ get_state(FeatureName) when is_atom(FeatureName) ->
682682
end
683683
end.
684684

685-
-spec get_stability(feature_name() | feature_props_extended()) -> stability().
685+
-spec get_stability
686+
(FeatureName) -> Stability | undefined when
687+
FeatureName :: feature_name(),
688+
Stability :: stability();
689+
(FeatureProps) -> Stability when
690+
FeatureProps :: feature_props_extended(),
691+
Stability :: stability().
686692
%% @doc
687693
%% Returns the stability of a feature flag.
688694
%%
@@ -696,12 +702,12 @@ get_state(FeatureName) when is_atom(FeatureName) ->
696702
%% <li>`experimental': the feature flag is experimental and may change in
697703
%% the future (without a guaranteed upgrade path): enabling it in
698704
%% production is not recommended.</li>
699-
%% <li>`unavailable': the feature flag is unsupported by at least one
700-
%% node in the cluster and can not be enabled for now.</li>
701705
%% </ul>
702706
%%
703707
%% @param FeatureName The name of the feature flag to check.
704-
%% @returns `stable' or `experimental'.
708+
%% @param FeatureProps A feature flag properties map.
709+
%% @returns `required', `stable' or `experimental', or `undefined' if the
710+
%% given feature flag name doesn't correspond to a known feature flag.
705711

706712
get_stability(FeatureName) when is_atom(FeatureName) ->
707713
case rabbit_ff_registry:get(FeatureName) of

0 commit comments

Comments
 (0)