Commit 3662a61
authored
I learned it's actually impossible (!) for consumers to implement
`CommandExt` because there are no public constructors for
[`OutputContext`]. Similarly, the lack of a public `maybe_error_message`
method requires a tedious workaround.
This introduces several new methods to fix these deficiencies:
- `OutputContext::new` lets you construct an `OutputContext`.
- `OutputContext::into_output_and_command` lets you deconstruct an
`OutputContext`. Previously, both these fields were accessible with
`into_output` and `into_command`, but you could only call one of those
methods, because they both take an owned `self` receiver.
- `OutputContext::output_error` is like `OutputContext::error`, but it
doesn't wrap the output in an `Error`, letting you use the
`OutputError::with_message` method.
1 parent 4b60eae commit 3662a61
1 file changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
64 | 77 | | |
65 | 78 | | |
66 | 79 | | |
67 | 80 | | |
| 81 | + | |
| 82 | + | |
68 | 83 | | |
69 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
70 | 94 | | |
71 | 95 | | |
72 | 96 | | |
| |||
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
89 | | - | |
| 113 | + | |
90 | 114 | | |
91 | 115 | | |
92 | 116 | | |
| |||
0 commit comments