From e3afdf0c2f4f120dfb4c926e1a011b51bd6651b4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 01/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-category/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-category/Cargo.toml b/bin/core/imag-category/Cargo.toml index 1333f8f8..5fb0c0a0 100644 --- a/bin/core/imag-category/Cargo.toml +++ b/bin/core/imag-category/Cargo.toml @@ -24,7 +24,7 @@ log = "0.4.6" toml = "0.5.1" toml-query = "0.9.2" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From 79472216173d155d7813b007d830a998f9c71080 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 02/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-diagnostics/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-diagnostics/Cargo.toml b/bin/core/imag-diagnostics/Cargo.toml index efae55fc..a2174327 100644 --- a/bin/core/imag-diagnostics/Cargo.toml +++ b/bin/core/imag-diagnostics/Cargo.toml @@ -19,7 +19,7 @@ toml = "0.5.1" toml-query = "0.9.2" indicatif = "0.12.0" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From de81e767d3fc0d67ffdbb5bb38da44549c48ce78 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 03/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-edit/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-edit/Cargo.toml b/bin/core/imag-edit/Cargo.toml index 590a9cce..2ec48cfc 100644 --- a/bin/core/imag-edit/Cargo.toml +++ b/bin/core/imag-edit/Cargo.toml @@ -25,7 +25,7 @@ version = "3.0.0" toml = "0.5.1" toml-query = "0.9.2" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From 6c842a9368d0b303b31a180d3808e767b852d543 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 04/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-grep/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-grep/Cargo.toml b/bin/core/imag-grep/Cargo.toml index d87ffde3..21cfee57 100644 --- a/bin/core/imag-grep/Cargo.toml +++ b/bin/core/imag-grep/Cargo.toml @@ -23,7 +23,7 @@ maintenance = { status = "actively-developed" } log = "0.4.6" regex = "1.1.7" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From 7680c538ae982f2be4ca895fa0ffdcb5232d3a05 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 05/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-header/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-header/Cargo.toml b/bin/core/imag-header/Cargo.toml index c619df43..24a14756 100644 --- a/bin/core/imag-header/Cargo.toml +++ b/bin/core/imag-header/Cargo.toml @@ -26,7 +26,7 @@ toml = "0.5.1" toml-query = "0.9.2" filters = "0.3.0" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From 99875785e5dbcbbe142bdc5a0b37e5ded2898540 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 06/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-ids/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-ids/Cargo.toml b/bin/core/imag-ids/Cargo.toml index 4dcd489f..036f3a06 100644 --- a/bin/core/imag-ids/Cargo.toml +++ b/bin/core/imag-ids/Cargo.toml @@ -24,7 +24,7 @@ log = "0.4.6" toml = "0.5.1" toml-query = "0.9.2" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From 72e2186d91b87f03b131be3f45d2a091444aa1b5 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 07/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-markdown/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-markdown/Cargo.toml b/bin/core/imag-markdown/Cargo.toml index 21311975..22f46c38 100644 --- a/bin/core/imag-markdown/Cargo.toml +++ b/bin/core/imag-markdown/Cargo.toml @@ -23,7 +23,7 @@ maintenance = { status = "actively-developed" } [dependencies] log = "0.4.6" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From c9fb7f685fa6064711fa3e82e19a74f4131a5e34 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 08/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-store/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-store/Cargo.toml b/bin/core/imag-store/Cargo.toml index 0624069d..d7a92de7 100644 --- a/bin/core/imag-store/Cargo.toml +++ b/bin/core/imag-store/Cargo.toml @@ -23,7 +23,7 @@ maintenance = { status = "actively-developed" } log = "0.4.6" toml = "0.5.1" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore", features = ["verify"] } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From 02b212feb38e2f278cb53c49ca4784066bf49a96 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:31:56 +0200 Subject: [PATCH 09/19] update: resiter v0.3.0 -> v0.4.0 Signed-off-by: Matthias Beyer --- bin/core/imag-view/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-view/Cargo.toml b/bin/core/imag-view/Cargo.toml index c5b4e3fe..335b80d1 100644 --- a/bin/core/imag-view/Cargo.toml +++ b/bin/core/imag-view/Cargo.toml @@ -26,7 +26,7 @@ toml-query = "0.9.2" handlebars = "2" tempfile = "3.0.9" failure = "0.1.5" -resiter = "0.3.0" +resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } From 580320c49632435baa3ddb6f26dd244d8ebbd007 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:32 +0200 Subject: [PATCH 10/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-category/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-category/src/lib.rs b/bin/core/imag-category/src/lib.rs index 07034d10..3a2a867d 100644 --- a/bin/core/imag-category/src/lib.rs +++ b/bin/core/imag-category/src/lib.rs @@ -53,7 +53,6 @@ use clap::App; use libimagerror::trace::MapErrTrace; use libimagrt::runtime::Runtime; use libimagrt::application::ImagApplication; -use libimagerror::iter::IterInnerOkOrElse; mod ui; @@ -62,6 +61,7 @@ use std::io::Write; use failure::err_msg; use failure::Error; use resiter::AndThen; +use resiter::IterInnerOkOrElse; use libimagentrycategory::store::CategoryStore; use libimagstore::iter::get::StoreIdGetIteratorExtension; From a92efdae4092982befba28f76d2a469707d4c131 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:32 +0200 Subject: [PATCH 11/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-diagnostics/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-diagnostics/src/lib.rs b/bin/core/imag-diagnostics/src/lib.rs index aeec93d6..78161d79 100644 --- a/bin/core/imag-diagnostics/src/lib.rs +++ b/bin/core/imag-diagnostics/src/lib.rs @@ -54,7 +54,6 @@ use libimagrt::application::ImagApplication; use libimagstore::store::FileLockEntry; use libimagstore::storeid::StoreId; use libimagentrylink::linkable::Linkable; -use libimagerror::iter::IterInnerOkOrElse; use toml::Value; use toml_query::read::TomlValueReadExt; @@ -63,6 +62,7 @@ use failure::Fallible as Result; use failure::err_msg; use clap::App; use resiter::AndThen; +use resiter::IterInnerOkOrElse; use std::collections::BTreeMap; From 9bcd99a1c040725e2c2a75c17917be12eab8003f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:32 +0200 Subject: [PATCH 12/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-edit/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-edit/src/lib.rs b/bin/core/imag-edit/src/lib.rs index 132aaea3..85d005fe 100644 --- a/bin/core/imag-edit/src/lib.rs +++ b/bin/core/imag-edit/src/lib.rs @@ -50,11 +50,11 @@ use libimagentryedit::edit::EditHeader; use libimagrt::runtime::Runtime; use libimagrt::application::ImagApplication; use libimagstore::iter::get::StoreIdGetIteratorExtension; -use libimagerror::iter::IterInnerOkOrElse; use failure::Fallible as Result; use failure::err_msg; use resiter::AndThen; +use resiter::IterInnerOkOrElse; use clap::App; mod ui; From 8d4a5dade8ed001fcae8e0dab2f99d483cb7c7ce Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:32 +0200 Subject: [PATCH 13/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-grep/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-grep/src/lib.rs b/bin/core/imag-grep/src/lib.rs index aadbcda5..ae75759b 100644 --- a/bin/core/imag-grep/src/lib.rs +++ b/bin/core/imag-grep/src/lib.rs @@ -52,11 +52,11 @@ use failure::Error; use failure::Fallible as Result; use failure::err_msg; use resiter::AndThen; +use resiter::IterInnerOkOrElse; use libimagrt::runtime::Runtime; use libimagrt::application::ImagApplication; use libimagstore::store::Entry; -use libimagerror::iter::IterInnerOkOrElse; mod ui; From 41323224f4e150aeed25cf43be5939781ecbde91 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:32 +0200 Subject: [PATCH 14/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-header/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-header/src/lib.rs b/bin/core/imag-header/src/lib.rs index 84ca045e..7617a16a 100644 --- a/bin/core/imag-header/src/lib.rs +++ b/bin/core/imag-header/src/lib.rs @@ -58,12 +58,12 @@ use failure::Fallible as Result; use failure::err_msg; use resiter::FilterMap; use resiter::AndThen; +use resiter::IterInnerOkOrElse; use libimagrt::runtime::Runtime; use libimagrt::application::ImagApplication; use libimagstore::iter::get::StoreIdGetIteratorExtension; use libimagstore::store::FileLockEntry; -use libimagerror::iter::IterInnerOkOrElse; use toml_query::read::TomlValueReadExt; use toml_query::read::TomlValueReadTypeExt; From c4e7dd482d6e776c7368af6de220ad06c68c2f2a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:32 +0200 Subject: [PATCH 15/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-markdown/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-markdown/src/lib.rs b/bin/core/imag-markdown/src/lib.rs index 1d88e4c2..7f18d5ce 100644 --- a/bin/core/imag-markdown/src/lib.rs +++ b/bin/core/imag-markdown/src/lib.rs @@ -50,12 +50,12 @@ use failure::err_msg; use failure::Fallible as Result; use resiter::AndThen; use resiter::Map; +use resiter::IterInnerOkOrElse; use clap::App; use libimagrt::runtime::Runtime; use libimagrt::application::ImagApplication; use libimagstore::iter::get::StoreIdGetIteratorExtension; -use crate::libimagerror::iter::IterInnerOkOrElse; mod ui; From e880fc3358a27ae6a6f39517c482d14bdf1e84d2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:33 +0200 Subject: [PATCH 16/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-store/src/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-store/src/verify.rs b/bin/core/imag-store/src/verify.rs index bf4c19d7..ac4efc63 100644 --- a/bin/core/imag-store/src/verify.rs +++ b/bin/core/imag-store/src/verify.rs @@ -22,9 +22,9 @@ use std::ops::Deref; use failure::Fallible as Result; use failure::err_msg; use resiter::AndThen; +use resiter::IterInnerOkOrElse; use libimagrt::runtime::Runtime; -use libimagerror::iter::IterInnerOkOrElse; /// Verify the store. /// From 0529fcc7adde0f93814d90ac69a336334fd5c062 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:32:33 +0200 Subject: [PATCH 17/19] Use resiter::IterInnerOkOrElse instead of libimagerror version Signed-off-by: Matthias Beyer --- bin/core/imag-view/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-view/src/lib.rs b/bin/core/imag-view/src/lib.rs index 6e721531..e0245308 100644 --- a/bin/core/imag-view/src/lib.rs +++ b/bin/core/imag-view/src/lib.rs @@ -60,6 +60,7 @@ use failure::Error; use failure::err_msg; use failure::Fallible as Result; use resiter::AndThen; +use resiter::IterInnerOkOrElse; use clap::App; use libimagrt::runtime::Runtime; @@ -69,7 +70,6 @@ use libimagentryview::builtin::md::MarkdownViewer; use libimagentryview::viewer::Viewer; use libimagstore::iter::get::StoreIdGetIteratorExtension; use libimagstore::store::FileLockEntry; -use libimagerror::iter::IterInnerOkOrElse; mod ui; From 434f84c80dc528cdefaf7b0e305e51ca039c3a4d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 17:27:07 +0200 Subject: [PATCH 18/19] Use resiter 0.4.0 for IterInnerOkOrElse extension --- bin/core/imag-mv/Cargo.toml | 1 + bin/core/imag-mv/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/core/imag-mv/Cargo.toml b/bin/core/imag-mv/Cargo.toml index 475ca01c..b8bdd374 100644 --- a/bin/core/imag-mv/Cargo.toml +++ b/bin/core/imag-mv/Cargo.toml @@ -22,6 +22,7 @@ maintenance = { status = "actively-developed" } [dependencies] log = "0.4.6" failure = "0.1.5" +resiter = "0.4.0" libimagrt = { version = "0.10.0", path = "../../../lib/core/libimagrt" } libimagerror = { version = "0.10.0", path = "../../../lib/core/libimagerror" } diff --git a/bin/core/imag-mv/src/lib.rs b/bin/core/imag-mv/src/lib.rs index e19cb6b0..6e50a7aa 100644 --- a/bin/core/imag-mv/src/lib.rs +++ b/bin/core/imag-mv/src/lib.rs @@ -36,6 +36,7 @@ #[macro_use] extern crate log; #[macro_use] extern crate failure; +extern crate resiter; extern crate clap; extern crate libimagrt; @@ -54,10 +55,10 @@ use libimagstore::store::Store; use libimagstore::store::FileLockEntry; use libimagentrylink::linkable::Linkable; use libimagstore::iter::get::StoreIdGetIteratorExtension; -use libimagerror::iter::IterInnerOkOrElse; use failure::Fallible as Result; use failure::err_msg; +use resiter::IterInnerOkOrElse; use clap::App; From 106be5746d7b264fba8056d9e382f8594334e346 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 16:33:05 +0200 Subject: [PATCH 19/19] Revert "Add extension traits for handling Result, E> conversion" This reverts commit d810b63886f4006d01bca894982bbc867616f37c. As resiter v0.4.0 does provide this extension now, we don't need it in the codebase anymore. --- lib/core/libimagerror/src/iter.rs | 46 ----------------------------- lib/core/libimagerror/src/lib.rs | 1 - lib/core/libimagerror/src/result.rs | 38 ------------------------ 3 files changed, 85 deletions(-) delete mode 100644 lib/core/libimagerror/src/result.rs diff --git a/lib/core/libimagerror/src/iter.rs b/lib/core/libimagerror/src/iter.rs index 1e7dbff9..5a288321 100644 --- a/lib/core/libimagerror/src/iter.rs +++ b/lib/core/libimagerror/src/iter.rs @@ -128,49 +128,3 @@ impl TraceIterator for I where I: Iterator> {} - -/// Extension trait for doing -/// -/// ```ignore -/// Iterator, E>> -> Iterator> -/// ``` -/// -pub trait IterInnerOkOrElse - where T: Sized, - E: Sized, - Self: Iterator, E>> + Sized, - F: Fn() -> E, -{ - fn map_inner_ok_or_else(self, f: F) -> IterInnerOkOrElseImpl; -} - -pub struct IterInnerOkOrElseImpl(I, F) - where I: Iterator, E>> + Sized, - T: Sized, - E: Sized, - F: Fn() -> E; - -impl IterInnerOkOrElse for I - where I: Iterator, E>> + Sized, - T: Sized, - E: Sized, - F: Fn() -> E, -{ - fn map_inner_ok_or_else(self, f: F) -> IterInnerOkOrElseImpl { - IterInnerOkOrElseImpl(self, f) - } -} - -impl Iterator for IterInnerOkOrElseImpl - where I: Iterator, E>> + Sized, - T: Sized, - E: Sized, - F: Fn() -> E, -{ - type Item = Result; - - fn next(&mut self) -> Option { - self.0.next().map(|e| e.and_then(|opt| opt.ok_or_else(|| (self.1)()))) - } -} - diff --git a/lib/core/libimagerror/src/lib.rs b/lib/core/libimagerror/src/lib.rs index 9b5e8407..22391142 100644 --- a/lib/core/libimagerror/src/lib.rs +++ b/lib/core/libimagerror/src/lib.rs @@ -44,7 +44,6 @@ pub mod errors; pub mod exit; pub mod io; pub mod iter; -pub mod result; pub mod str; pub mod trace; diff --git a/lib/core/libimagerror/src/result.rs b/lib/core/libimagerror/src/result.rs deleted file mode 100644 index 0dcb5333..00000000 --- a/lib/core/libimagerror/src/result.rs +++ /dev/null @@ -1,38 +0,0 @@ -// -// imag - the personal information management suite for the commandline -// Copyright (C) 2015-2019 the imag contributors -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; version -// 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// - -/// Extension trait for doing `Result, E> -> Result` -pub trait ResultOptionExt - where T: Sized, - E: Sized, - F: FnOnce() -> E -{ - fn inner_ok_or_else(self, f: F) -> Result; -} - -impl ResultOptionExt for Result, E> - where T: Sized, - E: Sized, - F: FnOnce() -> E -{ - fn inner_ok_or_else(self, f: F) -> Result { - self.and_then(|opt| opt.ok_or_else(f)) - } -} -