Skip to content

Commit

Permalink
pw_presubmit, pw_result: Use inclusive language
Browse files Browse the repository at this point in the history
Bug: 386
Change-Id: Id4e31e90d507e5814610dbbddc5259f829499826
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/46684
Pigweed-Auto-Submit: Rob Mohr <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Reviewed-by: Wyatt Hepler <[email protected]>
  • Loading branch information
mohrr authored and CQ Bot Account committed May 24, 2021
1 parent de9cc1b commit 203b333
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,11 @@ def run(install: bool, **presubmit_args) -> int:
"""Entry point for presubmit."""

if install:
# TODO(pwbug/209, pwbug/386) inclusive-language: disable
install_hook(__file__, 'pre-push',
['--base', 'origin/master..HEAD', '--program', 'quick'],
Path.cwd())
# TODO(pwbug/209, pwbug/386) inclusive-language: enable
return 0

return cli.run(**presubmit_args)
Expand Down
8 changes: 4 additions & 4 deletions pw_result/public/pw_result/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class [[nodiscard]] Result {
constexpr Result(std::in_place_t, Args&&... args)
: value_(std::forward<Args>(args)...), status_(OkStatus()) {}

constexpr Result(Status status) : dummy_({}), status_(status) {
constexpr Result(Status status) : unused_({}), status_(status) {
PW_ASSERT(!status_.ok());
}
constexpr Result(Status::Code code) : dummy_({}), status_(code) {
constexpr Result(Status::Code code) : unused_({}), status_(code) {
PW_ASSERT(!status_.ok());
}

Expand Down Expand Up @@ -95,13 +95,13 @@ class [[nodiscard]] Result {
constexpr void IgnoreError() const {}

private:
struct Dummy {};
struct Unused {};

union {
T value_;

// Ensure that there is always a trivial constructor for the union.
Dummy dummy_;
Unused unused_;
};
Status status_;
};
Expand Down

0 comments on commit 203b333

Please sign in to comment.