Demote ControlFlow::{from|into}_try to pub(crate)
This commit is contained in:
parent
3bcaeb0bf9
commit
b63f7f9965
@ -186,9 +186,8 @@ pub fn map_break<T, F>(self, f: F) -> ControlFlow<T, C>
|
||||
#[cfg(bootstrap)]
|
||||
impl<R: ops::TryV1> ControlFlow<R, R::Output> {
|
||||
/// Create a `ControlFlow` from any type implementing `Try`.
|
||||
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
|
||||
#[inline]
|
||||
pub fn from_try(r: R) -> Self {
|
||||
pub(crate) fn from_try(r: R) -> Self {
|
||||
match R::into_result(r) {
|
||||
Ok(v) => ControlFlow::Continue(v),
|
||||
Err(v) => ControlFlow::Break(R::from_error(v)),
|
||||
@ -196,9 +195,8 @@ pub fn from_try(r: R) -> Self {
|
||||
}
|
||||
|
||||
/// Convert a `ControlFlow` into any type implementing `Try`;
|
||||
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
|
||||
#[inline]
|
||||
pub fn into_try(self) -> R {
|
||||
pub(crate) fn into_try(self) -> R {
|
||||
match self {
|
||||
ControlFlow::Continue(v) => R::from_ok(v),
|
||||
ControlFlow::Break(v) => v,
|
||||
@ -206,12 +204,14 @@ pub fn into_try(self) -> R {
|
||||
}
|
||||
}
|
||||
|
||||
/// These are used only as part of implementing the iterator adapters.
|
||||
/// They have mediocre names and non-obvious semantics, so aren't
|
||||
/// currently on a path to potential stabilization.
|
||||
#[cfg(not(bootstrap))]
|
||||
impl<R: ops::TryV2> ControlFlow<R, R::Output> {
|
||||
/// Create a `ControlFlow` from any type implementing `Try`.
|
||||
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
|
||||
#[inline]
|
||||
pub fn from_try(r: R) -> Self {
|
||||
pub(crate) fn from_try(r: R) -> Self {
|
||||
match R::branch(r) {
|
||||
ControlFlow::Continue(v) => ControlFlow::Continue(v),
|
||||
ControlFlow::Break(v) => ControlFlow::Break(R::from_residual(v)),
|
||||
@ -219,9 +219,8 @@ pub fn from_try(r: R) -> Self {
|
||||
}
|
||||
|
||||
/// Convert a `ControlFlow` into any type implementing `Try`;
|
||||
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
|
||||
#[inline]
|
||||
pub fn into_try(self) -> R {
|
||||
pub(crate) fn into_try(self) -> R {
|
||||
match self {
|
||||
ControlFlow::Continue(v) => R::from_output(v),
|
||||
ControlFlow::Break(v) => v,
|
||||
|
Loading…
Reference in New Issue
Block a user