Skip to content

Conversation

@9999years
Copy link
Owner

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.

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.
@9999years 9999years force-pushed the wiggles/push-vplyspznqvxq branch from 53f2d50 to 24d66bd Compare September 18, 2025 20:00
@9999years 9999years merged commit 3662a61 into main Sep 18, 2025
34 checks passed
@9999years 9999years deleted the wiggles/push-vplyspznqvxq branch September 18, 2025 21:38
@github-actions
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants