mirror of
https://github.com/IBM/fp-go.git
synced 2025-08-10 22:31:32 +02:00
fix: remove unnecesary indirection in E.TryCatch
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@@ -58,10 +58,8 @@ func TestSampleConvertDocx2(t *testing.T) {
|
||||
// The disadvantage is that its input has to exist in memory which is probably not a good
|
||||
// idea for large inputs
|
||||
convertDocx := func(data []byte) E.Either[error, T.Tuple2[string, map[string]string]] {
|
||||
return E.TryCatchError(func() (T.Tuple2[string, map[string]string], error) {
|
||||
text, meta, err := sampleConvertDocx(bytes.NewReader(data))
|
||||
return T.MakeTuple2(text, meta), err
|
||||
})
|
||||
text, meta, err := sampleConvertDocx(bytes.NewReader(data))
|
||||
return E.TryCatchError(T.MakeTuple2(text, meta), err)
|
||||
}
|
||||
|
||||
resE := convertDocx([]byte("abc"))
|
||||
|
Reference in New Issue
Block a user