Skip to content

B4/rust binder impl flags#4

Open
jahnavi-MN496 wants to merge 4 commits into
Darksonn:rust-binder-basefrom
jahnavi-MN496:b4/rust_binder_impl_flags
Open

B4/rust binder impl flags#4
jahnavi-MN496 wants to merge 4 commits into
Darksonn:rust-binder-basefrom
jahnavi-MN496:b4/rust_binder_impl_flags

Conversation

@jahnavi-MN496

Copy link
Copy Markdown

No description provided.

# Describe the purpose of this series. The information you put here
# will be used by the project maintainer to make a decision whether
# your patches should be reviewed, and in what priority order. Please be
# very detailed and link to any relevant discussions or sites that the
# maintainer can review to better understand your proposed changes. If you
# only have a single patch in your series, the contents of the cover
# letter will be appended to the "under-the-cut" portion of the patch.

# Lines starting with # will be removed from the cover letter. You can
# use them to add notes or reminders to yourself. If you want to use
# markdown headers in your cover letter, start the line with ">#".

# You can add trailers to the cover letter. Any email addresses found in
# these trailers will be added to the addresses specified/generated
# during the b4 send stage. You can also run "b4 prep --auto-to-cc" to
# auto-populate the To: and Cc: trailers based on the code being
# modified.

Change-Id: I8375178251d97e7ad784a6ccd8c108c0d2d2b2eb
Signed-off-by: Jahnavi MN <jahnavimn@google.com>

--- b4-submit-tracking ---
# This section is used internally by b4 prep for tracking purposes.
{
  "series": {
    "revision": 1,
    "change-id": "20260715-b4-rust_binder_impl_flags-e53b4ebca85d",
    "prefixes": []
  }
}
Change-Id: I4fca5149ede246c04b43b0cce94e7fd6faa996a5
Change-Id: Ifbec19f2d212483f0462c30e732908a1c73793bf
Change-Id: I7d8cd4298af651fc862896bf2a87caf6e2c3ceb4

if self.flags & old.flags & (TF_ONE_WAY | TF_UPDATE_TXN) != (TF_ONE_WAY | TF_UPDATE_TXN) {
let required = TransactionFlag::OneWay | TransactionFlag::UpdateTxn;
if !self.flags.contains_all(required) || !old.flags.contains_all(required) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a super minor thing, but I would find it easier to read like this.

Suggested change
if !self.flags.contains_all(required) || !old.flags.contains_all(required) {
if !(self.flags.contains_all(required) && old.flags.contains_all(required)) {

#[inline]
pub(crate) fn is_oneway(&self) -> bool {
self.flags & TF_ONE_WAY != 0
self.flags.contains(TransactionFlag::OneWay)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We check flags.contains(TransactionFlag::OneWay) super often. It might be nice to add a helper function called is_oneway() on TransactionFlags type to make these calls even shorter and easier to read.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants