|
1 | 1 | open SharedTypes;
|
2 | 2 |
|
3 |
| -let fileForCmt = (~moduleName, ~uri, cmt, processDoc) => { |
4 |
| - let%try infos = Shared.tryReadCmt(cmt); |
5 |
| - Ok(ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos)); |
6 |
| -}; |
| 3 | +let fileForCmt = (~moduleName, ~uri, cmt, processDoc) => |
| 4 | + switch (Shared.tryReadCmt(cmt)) { |
| 5 | + | Error(e) => Error(e) |
| 6 | + | Ok(infos) => Ok(ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos)) |
| 7 | + }; |
7 | 8 |
|
8 |
| -let fullForCmt = (~moduleName, ~uri, cmt, processDoc) => { |
9 |
| - let%try infos = Shared.tryReadCmt(cmt); |
10 |
| - let file = ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos); |
11 |
| - let extra = ProcessExtra.forCmt(~file, infos); |
12 |
| - Ok({file, extra}); |
13 |
| -}; |
| 9 | +let fullForCmt = (~moduleName, ~uri, cmt, processDoc) => |
| 10 | + switch (Shared.tryReadCmt(cmt)) { |
| 11 | + | Error(e) => Error(e) |
| 12 | + | Ok(infos) => |
| 13 | + let file = ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos); |
| 14 | + let extra = ProcessExtra.forCmt(~file, infos); |
| 15 | + Ok({file, extra}); |
| 16 | + }; |
14 | 17 |
|
15 | 18 | module PrintType = PrintType;
|
0 commit comments