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

style: simplify statements for readability #3143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hamirmahal
Copy link

Fixes #3142

Motivation

We can simplify some statements, like

(len, format!("http://{}/{}", authority, letter))

to improve code readability.

Solution

We replace lines like

(len, format!("http://{}/{}", authority, letter))

with

(len, format!("http://{authority}/{letter}"))

Copy link
Author

@hamirmahal hamirmahal left a comment

Choose a reason for hiding this comment

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

This shouldn't cause any user-facing changes.

The goal of this pull request is to improve code readability and maintainability.

Copy link
Contributor

@kaffarell kaffarell left a comment

Choose a reason for hiding this comment

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

LGTM! Maybe reword the first commit message though – something like "examples: inline variables" would be better IMO.

@hamirmahal
Copy link
Author

Sure! I'll do that right now.

@hamirmahal hamirmahal force-pushed the style/simplify-statements-for-readability branch from 90f2430 to eeab913 Compare November 20, 2024 21:06
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.

Some statements can be simplified for readability
2 participants