Skip to content

Conversation

@art049
Copy link
Member

@art049 art049 commented Jul 18, 2025

Changes

  • Refactored get_pipe_open_options() function to use a single mutable variable approach instead of multiple early returns
  • Added conditional #[cfg_attr(not(target_os = "linux"), allow(unused_mut))] attribute to suppress unused mut warnings on non-Linux platforms
  • Makes the code more concise and maintainable while preserving the same functionality

Benefits

  • Reduces code duplication
  • Eliminates early returns for cleaner control flow
  • Resolves linter warnings about unused mutable variables on non-Linux platforms
  • Maintains the same compile-time conditional behavior

Testing

  • Functionality remains unchanged - the same conditional compilation behavior is preserved
  • Reduces from 6 lines to 5 lines with better readability

@art049 art049 requested a review from not-matthias July 18, 2025 15:19
- Replace multiple early returns with a single mutable variable approach
- Add conditional allow(unused_mut) attribute for non-Linux platforms
- Makes the code more concise while maintaining the same functionality
@art049 art049 force-pushed the refactor/improve-pipe-options-conditional-compilation branch from 56ca598 to c7e68dd Compare August 25, 2025 16:11
@art049 art049 merged commit c7e68dd into main Aug 25, 2025
5 of 7 checks passed
@art049 art049 deleted the refactor/improve-pipe-options-conditional-compilation branch August 25, 2025 16:18
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.

3 participants