Skip to content

cargo fmt PR 376#377

Merged
ivmarkov merged 2 commits intoproject-chip:mainfrom
sysgrok:gen-diag-error
Feb 13, 2026
Merged

cargo fmt PR 376#377
ivmarkov merged 2 commits intoproject-chip:mainfrom
sysgrok:gen-diag-error

Conversation

@ivmarkov
Copy link
Contributor

@ivmarkov ivmarkov commented Feb 13, 2026

Subject says it all - apply a cargo fmt to PR #376.

thouters and others added 2 commits February 11, 2026 23:12
Fix light_eth example of rs-matter-stack.

fn network_interfaces() gets called with
ArrayAttributeRead::ReadOne index beyond the length of the interfaces
present.

Return a ConstraintError when no netif was matched.

The change fixes this error message which aborts the commissioning
process:

rs_matter::respond] Responder: Handler 0 / exchange 7::1: Abandoned
because of error Error::InvalidAction
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ivmarkov, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request, while titled as a cargo fmt run, includes both code formatting adjustments and a functional change to error handling. Specifically, it refines the error code returned when a parent builder is unexpectedly empty, switching from a general 'Invalid Action' to a more precise 'Constraint Error'. The formatting changes improve the readability of the affected code block.

Highlights

  • Error Handling Refinement: Updated an error code from ErrorCode::InvalidAction to ErrorCode::ConstraintError in the gen_diag.rs file, providing a more specific error type for a particular scenario.
  • Code Formatting: Applied cargo fmt style changes, which included reformatting a multi-line expression for improved readability.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • rs-matter/src/dm/clusters/gen_diag.rs
    • Changed the error code returned from ErrorCode::InvalidAction to ErrorCode::ConstraintError when parent_builder.take() results in None.
    • Reformatted the parent_builder.take().ok_or_else(...) expression to span multiple lines for better code clarity.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request, titled as a formatting change, also modifies an error code. While the formatting is fine, the new error code ConstraintError is not the most appropriate for the situation. According to the Matter specification, when trying to access a list element at an index that doesn't exist, UNSUPPORTED_ACCESS should be returned. I've added a comment to suggest using the correct error code.

@ivmarkov
Copy link
Contributor Author

Merging because PR #376 was already approved. It just needs formatting.

@github-actions
Copy link

PR #377: Size comparison from d502046 to 44f3e13

Full report (8 builds for (core), dimmable-light, onoff-light, onoff-light-bt, speaker)
platform target config section d502046 44f3e13 change % change
(core) riscv32imac-unknown-none-elf infodefmt-optz-ltofat FLASH 378316 378314 -2 -0.0
RAM 64712 64712 0 0.0
thumbv6m-none-eabi infodefmt-optz-ltofat FLASH 317900 317912 12 0.0
RAM 61248 61248 0 0.0
thumbv7em-none-eabi infodefmt-optz-ltofat FLASH 291340 291340 0 0.0
RAM 60736 60740 4 0.0
x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 811159 811111 -48 -0.0
RAM 64400 64400 0 0.0
dimmable-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 1873952 1873128 -824 -0.0
RAM 46584 46584 0 0.0
onoff-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 1800640 1799840 -800 -0.0
RAM 46576 46576 0 0.0
onoff-light-bt x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 3113920 3111184 -2736 -0.1
RAM 9304 9304 0 0.0
speaker x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 801104 800864 -240 -0.0
RAM 2832 2832 0 0.0

@ivmarkov ivmarkov merged commit bb6782a into project-chip:main Feb 13, 2026
13 checks passed
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