Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: Add panic if neopixel does not exist #92

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

patrickelectric
Copy link
Member

No description provided.

src/lib.rs Outdated
Comment on lines 353 to 357
if let Some(rgb_behaviour) = self.get_rgb_behaviour() {
rgb_behaviour.set_colors_rgbw(colors).unwrap();
} else {
panic!("No RGB controller available");
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if let Some(rgb_behaviour) = self.get_rgb_behaviour() {
rgb_behaviour.set_colors_rgbw(colors).unwrap();
} else {
panic!("No RGB controller available");
}
self
.get_rgb_behaviour()
.expect("No RGB controller available")
.set_colors_rgbw(colors)
.expect("Failed to set RGB colors");

Copy link
Member Author

Choose a reason for hiding this comment

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

Check now

Signed-off-by: Patrick José Pereira <[email protected]>
@joaoantoniocardoso joaoantoniocardoso merged commit f5ce766 into bluerobotics:master Dec 9, 2024
6 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