Onelinerhub / onelinerhub

Thousands of code solutions with clear explanation @ onelinerhub.com
https://onelinerhub.com
MIT License
810 stars 161 forks source link

Short solution needed: "Rust lang loops" (rust) #1937

Closed nonunicorn closed 1 year ago

nonunicorn commented 1 year ago

Please help us write most modern and shortest code solution for this issue: Rust lang loops (technology: rust)

Fast way

Just write the code solution in the comments.

Prefered way

  1. Create pull request with a new code file inside inbox folder.
  2. Don't forget to use comments explain solution.
  3. Link to this issue in comments of pull request.
devmalik7 commented 1 year ago

Issue Number-#1937

Infinite loops Syntax InfiniteLoopExpression : loop [BlockExpression]

A loop expression repeats execution of its body continuously.

Predicate loops Syntax PredicateLoopExpression : while [Expression] except struct expression [BlockExpression]

A while loop begins by evaluating the boolean loop conditional operand.

nonunicorn commented 1 year ago