Rust rules
tx0 checks .rs files with 233 rules, 35 of them in the default tier. Files that say a tool generated them are skipped. Each rule's page explains what it finds and what it leaves alone.
Default: 35 rules
Bugs and security problems with measured precision. They run without a tx0.toml.
-
tx0/rust:assert-same-argumentsdefaultassert_eq!orassert_ne!compares an expression with itself -
tx0/rust:assignment-looks-like-compounddefaulta =- b,a =! bora =* bassigns a negated or dereferenced value where-=,!=or*=was likely meant -
tx0/rust:async-block-never-awaiteddefaultAn
asyncblock is a statement of its own, so the future it makes is dropped and its code never runs -
tx0/rust:bit-mask-comparison-constantdefaultA value masked with
&or|is compared with a constant that the mask makes impossible -
tx0/rust:dangling-cstring-pointerdefaultas_ptris called on a temporaryCString, whose memory is freed at once -
tx0/rust:drop-of-referencedefaultdropormem::forgetis called with a reference, which does nothing -
tx0/rust:duplicate-conditiondefaultA condition in an
else ifchain repeats an earlier one -
tx0/rust:escape-zero-then-digitdefaultA string has
\0followed by a digit, which Rust reads as a NUL character and a digit, not as an octal escape -
tx0/rust:guard-dropped-at-oncedefaultThe guard of a lock is bound to
_and released at once -
tx0/rust:identical-branchesdefaultBoth branches of an
ifare the same -
tx0/rust:identical-operandsdefaultBoth operands of a binary operator are the same expression
-
tx0/rust:impossible-length-checkdefaultA length is compared with zero in a way whose outcome is fixed
-
tx0/rust:infinite-iterator-consumeddefaultAn endless iterator is consumed by a method that never returns
-
tx0/rust:lazy-iterator-droppeddefaultAn iterator adapter such as
maporfilteris called as a statement, so its closure never runs -
tx0/rust:literal-cast-out-of-rangedefaultAn integer literal is cast with
asto a type too small for it, so the value silently changes -
tx0/rust:loop-over-optiondefaultA
forloop iterates over theOptionofnext()orok() -
tx0/rust:mutable-from-shared-referencedefaultA function takes only shared references and returns a mutable one, which lets two
&mutto the same data exist -
tx0/rust:nan-comparisondefaultA value is compared with NaN, which no comparison matches
-
tx0/rust:pointer-to-temporarydefaultA raw pointer is taken from a temporary value that is dropped at the end of the statement
-
tx0/rust:recursive-displaydefaultA
DisplayorDebugimplementation formatsselfwith itself -
tx0/rust:reversed-assign-operatordefault=-,=!or=*is written where a compound assignment was likely meant -
tx0/rust:reversed-rangedefaultA range of literals starts after it ends, so it is empty
-
tx0/rust:rng-seeded-with-constantdefaultA random generator is seeded with a constant, so it produces the same numbers every run
-
tx0/rust:same-lock-taken-twicedefaultA statement locks the same mutex twice, which deadlocks because the first guard is still alive
-
tx0/rust:self-assignmentdefaultA place is assigned to itself
-
tx0/rust:serde-duplicate-namedefaultTwo fields of a struct are renamed by
serdeto the same name, so one of them cannot be read or written -
tx0/rust:serde-flatten-with-deny-unknown-fieldsdefaultA struct uses
#[serde(flatten)]together withdeny_unknown_fields, whichserdedoes not support -
tx0/rust:step-by-zerodefaultstep_by(0)is called, which panics -
tx0/rust:swap-loses-valuedefaulta = b; b = a;tries to swap two values but sets both to the value ofb -
tx0/rust:tls-verification-disableddefaultTLS certificate or host name verification is turned off
-
tx0/rust:token-signature-not-checkeddefaultA JSON web token is decoded without checking its signature
-
tx0/rust:uninitialized-memorydefaultA value is made from uninitialized memory
-
tx0/rust:unwrap-after-failed-checkdefaultA value is unwrapped in the branch where it was found to be empty or an error
-
tx0/rust:xor-as-powerdefault2 ^ nor10 ^ nis written, which is exclusive or and not a power -
tx0/rust:zero-divided-by-zerodefault0.0 / 0.0is written to get NaN, which reads like a mistake
Recommended: 64 rules
Likely bugs, resource and performance problems.
-
tx0/rust:approximate-constantrecommendedA float literal approximates a constant that
std::f64::constsprovides -
tx0/rust:arc-around-single-thread-cellrecommendedAn
Archolds aRefCell,CellorRc, which cannot be shared between threads -
tx0/rust:atomic-load-then-storerecommendedAn atomic is stored with a value computed from its own
load, which loses updates made in between -
tx0/rust:block-on-in-asyncrecommendedAn async function blocks on another future with
block_on, which can stall or deadlock the executor -
tx0/rust:blocking-call-in-asyncrecommendedAn async body calls
thread::sleeporblock_on, which block the executor -
tx0/rust:bool-literal-comparisonrecommendedA boolean is compared with
trueorfalse -
tx0/rust:chars-nth-in-looprecommendeds.chars().nth(i)is called in a loop, which walks the string from the start on every pass -
tx0/rust:complex-conditionrecommendedA boolean expression has more
&&and||operators than the configured maximum -
tx0/rust:condvar-wait-outside-looprecommendedCondvar::waitis called outside a loop, so a spurious wakeup continues as if the condition held -
tx0/rust:const-to-mut-castrecommendedA shared reference or
*constpointer is cast to*mut -
tx0/rust:constant-assertionrecommendedAn assertion's condition is the literal
trueorfalse -
tx0/rust:debug-assert-side-effectrecommendedThe condition of a
debug_assert!changes state, which release builds skip -
tx0/rust:deep-nestingrecommendedControl flow is nested deeper than the configured maximum
-
tx0/rust:derive-with-manual-counterpartrecommendedHashorOrdis derived whilePartialEqorPartialOrdis written by hand -
tx0/rust:derived-debug-shows-secretrecommendedA struct derives
Debugand has a field named like a password, key or token, which{:?}prints in clear text -
tx0/rust:double-negationrecommendedA negation is applied directly to a negation
-
tx0/rust:empty-looprecommendedA
loophas an empty body and spins forever -
tx0/rust:environment-changed-at-run-timerecommendedstd::env::set_varorremove_varchanges the environment, which races with every other thread that reads it -
tx0/rust:exit-in-libraryrecommendedLibrary code calls
std::process::exit -
tx0/rust:exit-status-ignoredrecommendedA command is run and its exit status thrown away, so a failing command goes unnoticed
-
tx0/rust:fixed-temp-pathrecommendedA fixed path in the shared temporary directory is used
-
tx0/rust:float-literal-cast-to-integerrecommendedA float literal with a fraction is cast to an integer type, which drops the fraction
-
tx0/rust:format-inside-formatrecommendedThe argument of a formatting macro is built with
format!, which allocates a string only to format it again -
tx0/rust:hardcoded-credentialrecommendedA secret such as a password or token is written into the source
-
tx0/rust:high-complexityrecommendedA function has more decision points than the configured maximum
-
tx0/rust:inherent-to-stringrecommendedA type defines its own
to_stringmethod instead of implementingDisplay -
tx0/rust:invisible-character-in-literalrecommendedA string or character literal holds an invisible or direction-changing character
-
tx0/rust:large-array-on-stackrecommendedA local array of more than 512 KiB is created on the stack, which can overflow it
-
tx0/rust:leading-zero-literalrecommendedA decimal integer literal starts with a zero
-
tx0/rust:leftover-dbgrecommendedA
dbg!invocation is left in the code -
tx0/rust:leftover-placeholderrecommendedA
todo!placeholder is left in the code -
tx0/rust:lock-held-across-awaitrecommendedA lock guard or
RefCellborrow is held across an.await -
tx0/rust:long-filerecommendedA file has more lines than the configured maximum
-
tx0/rust:long-functionrecommendedA function has more lines than the configured maximum
-
tx0/rust:long-parameter-listrecommendedA function takes more parameters than the configured maximum
-
tx0/rust:mem-forgetrecommendedstd::mem::forgetdrops a value without running its destructor, which leaks it -
tx0/rust:midpoint-overflowrecommended(low + high) / 2can overflow for large bounds -
tx0/rust:mismatched-shared-cellrecommendedRcholds a lock, orArcholds aRefCellorCell -
tx0/rust:missing-elserecommendedAn
ifstarts on the line where the previousifends, withoutelse -
tx0/rust:missing-safety-docrecommendedA public
unsafe fnhas no# Safetysection in its documentation -
tx0/rust:needless-bool-ifrecommendedAn
ifreturnstruein one branch andfalsein the other -
tx0/rust:panic-in-function-returning-resultrecommendedA function that returns
Resultpanics, though it has a way to report the error to its caller -
tx0/rust:partial-cmp-unwraprecommendedpartial_cmp(..).unwrap()panics when a float is NaN, wheretotal_cmporders every value -
tx0/rust:partial-read-write-ignoredrecommendedThe count returned by
readorwriteis dropped, so a partial read or write goes unnoticed -
tx0/rust:path-join-absoluterecommendedA path is joined with a string that starts with
/, which replaces the path instead of extending it -
tx0/rust:pointer-in-pointerrecommendedA
Box,RcorArcholds another box, adding an allocation and an indirection for nothing -
tx0/rust:regex-in-looprecommendedA regular expression is compiled inside a loop
-
tx0/rust:remainder-by-onerecommendedAn integer remainder by one is computed, which is always zero
-
tx0/rust:secret-in-log-macrorecommendedA variable named like a password, token or secret is written with a logging macro
-
tx0/rust:set-len-on-uninitializedrecommendedA vector made with
with_capacitygets its length set withset_lenbefore its elements are written -
tx0/rust:set-readonly-falserecommendedset_readonly(false)makes a file writable for every user on Unix -
tx0/rust:shell-command-builtrecommendedA shell runs a command string that is not a literal
-
tx0/rust:shift-precedencerecommendedAn arithmetic operation is an unparenthesized operand of a shift
-
tx0/rust:sql-built-with-formatrecommendedA SQL query is built with
format!from values -
tx0/rust:static-mutrecommendedA
static mutis declared -
tx0/rust:unchecked-utf8-conversionrecommendedBytes are turned into a string with
from_utf8_unchecked, which is undefined behaviour if they are not valid UTF-8 -
tx0/rust:undocumented-unsafe-blockrecommendedAn
unsafeblock has no// SAFETY:comment -
tx0/rust:undocumented-unsafe-implrecommendedAn
unsafe implhas no// SAFETY:comment -
tx0/rust:unwrap-outside-testsrecommendedunwrap()is called outside tests -
tx0/rust:vec-repeat-shares-pointerrecommendedvec![Rc::new(x); n]clones the pointer, so every element shares one value -
tx0/rust:weak-cipherrecommendedA broken cipher or the ECB mode is used
-
tx0/rust:weak-hashrecommendedMD5 or SHA-1 is used
-
tx0/rust:wildcard-in-or-patternrecommendedA
|pattern lists alternatives next to_, which matches everything anyway -
tx0/rust:world-writable-permissionsrecommendedA file mode lets every user write
Strict: 77 rules
Code that can be written more plainly.
-
tx0/rust:alloc-result-uncheckedstrictThe pointer returned by a raw allocation is used without checking it for null
-
tx0/rust:allocating-fallbackstrictThe fallback of
unwrap_oror a similar method allocates even when unused -
tx0/rust:assert-is-okstrictassert!(x.is_ok())fails without showing the error, whichx.unwrap()would print -
tx0/rust:blocking-io-in-asyncstrictAn async body does file or process I/O through
std, which blocks the executor's thread -
tx0/rust:bool-assert-comparisonstrictassert_eq!orassert_ne!compares with a boolean literal -
tx0/rust:boxed-collectionstrictA heap-allocated collection is boxed
-
tx0/rust:boxed-error-in-public-apistrictA public function of a library returns
Box<dyn Error>, which its callers cannot match on -
tx0/rust:bytes-countstricts.bytes().count()walks the string to count whats.len()knows -
tx0/rust:cleartext-urlstrictAn
http://URL to a remote host is written in the code -
tx0/rust:collapsible-ifstrictAn
ifis the only content of anotheriforelseand could be merged with it -
tx0/rust:collect-then-countstrictAn iterator is collected only to take the length of the result
-
tx0/rust:collect-to-check-emptystrictAn iterator is collected only to ask whether the result is empty
-
tx0/rust:constant-ivstrictA nonce or initialization vector is a constant, so it repeats for every message
-
tx0/rust:cookie-without-protectionstrictA cookie is built with its
SecureorHttpOnlyattribute turned off -
tx0/rust:cors-any-originstrictA CORS policy accepts requests from any origin
-
tx0/rust:deny-warnings-in-sourcestrict#![deny(warnings)]in the source makes the crate fail to build whenever a new compiler adds a warning -
tx0/rust:discarded-errorstrict.ok()is called on a result only to throw the error away -
tx0/rust:eager-expect-messagestrictThe message of
expectis formatted even when it is not needed -
tx0/rust:error-cause-discardedstrictmap_err(|_| ...)replaces an error with another and drops the original, with its message and source -
tx0/rust:expect-outside-testsstrictexpect()is called outside tests -
tx0/rust:extend-from-cloned-iterstrictv.extend(s.iter().cloned())copies a slice element by element whereextend_from_slicecopies it at once -
tx0/rust:filter-then-nextstrictfilter(..).next()is called, whichfinddoes in one step -
tx0/rust:float-literal-equalitystrictA float is compared for equality with an inexact literal
-
tx0/rust:identical-match-armsstrictTwo arms of a
matchhave the same body -
tx0/rust:identity-mapstrictmapis called with a closure that returns its argument -
tx0/rust:identity-operationstrictAn arithmetic or bitwise operation with its identity element
-
tx0/rust:ignored-test-without-reasonstrictA test is marked
#[ignore]without a reason -
tx0/rust:index-into-empty-vecstrictA vector that was just created empty is indexed, which panics
-
tx0/rust:index-one-past-endstrictA slice is indexed at its length, one past its last element
-
tx0/rust:index-outside-testsstrictAn index or slice expression, which can panic, is used outside tests
-
tx0/rust:inline-alwaysstrict#[inline(always)]overrides the compiler's inlining decisions, which usually makes code larger and not faster -
tx0/rust:iter-cloned-collectstrict.iter().cloned().collect::<Vec<_>>()copies a slice element by element whereto_vec()does it at once -
tx0/rust:iter-count-for-lenstrict.iter().count()walks a collection to count what.len()knows -
tx0/rust:len-zero-comparisonstrictA length is compared with zero or one instead of calling
is_empty -
tx0/rust:linked-liststrictA
LinkedListis used, which is slower thanVecorVecDequefor almost every use -
tx0/rust:listen-on-all-interfacesstrictA server binds to
0.0.0.0or[::], which accepts connections from every network -
tx0/rust:many-bool-fieldsstrictA struct has more
boolfields than the configured maximum -
tx0/rust:match-on-boolstrictA
matchon a boolean has arms fortrueandfalse -
tx0/rust:mutex-of-primitivestrictA
Mutexguards a single boolean or integer -
tx0/rust:needless-question-markstrictOk(x?)orSome(x?)is returned wherexwould do -
tx0/rust:needless-returnstrictA function ends with
returnwhere its last expression would do -
tx0/rust:negated-condition-with-elsestrictAn
ifwith anelsebranch tests a negated condition -
tx0/rust:nested-optionstrictAn
Optionholds anotherOption -
tx0/rust:newline-in-formatstrictA line ending is written by hand where the
lnform of the macro does it -
tx0/rust:one-char-string-patternstrictA string method is given a one-character string as pattern, where a
charis faster -
tx0/rust:owned-type-reference-paramstrictA parameter takes
&Vec,&Stringor&PathBufwhere a slice type would accept more -
tx0/rust:panic-across-ffistrictA function with a foreign ABI unwraps a value, and a panic there aborts the process
-
tx0/rust:panic-in-dropstrictA destructor unwraps a value, and a panic there aborts the process during unwinding
-
tx0/rust:panic-outside-testsstrictpanic!orunimplemented!is invoked outside tests -
tx0/rust:partial-eq-defines-nestrictA
PartialEqimplementation definesne, which can then disagree witheq -
tx0/rust:predictable-secretstrictA secret such as a token or password is made with a generator that is not cryptographically secure
-
tx0/rust:print-in-librarystrictLibrary code prints to standard output or standard error
-
tx0/rust:push-formatted-stringstrictpush_str(&format!(...))allocates a temporary string wherewrite!appends directly -
tx0/rust:push-str-one-charstrictpush_strappends a one-character string literal, wherepushwith achardoes it directly -
tx0/rust:read-line-buffer-not-clearedstrictA loop reads lines into one buffer without clearing it, so each line is appended to the last
-
tx0/rust:redundant-closurestrictA closure only calls a function with its own argument
-
tx0/rust:remove-front-in-loopstrictA loop removes or inserts at the front of a vector, which shifts all its elements each time
-
tx0/rust:replace-with-defaultstrictmem::replaceputs a default value in place, whichmem::takedoes -
tx0/rust:request-path-in-file-accessstrictA file path is built from a request parameter without checking that it stays in its directory
-
tx0/rust:search-then-is-somestrict.find(p).is_some()or.position(p).is_some()asks for an element only to check that one exists -
tx0/rust:send-sync-impl-without-boundstrictSendorSyncis implemented for a generic type without requiring it of the type parameter -
tx0/rust:shared-owned-bufferstrictAn
RcorArcholds aStringorVec, adding a second allocation whereRc<str>orRc<[T]>has one -
tx0/rust:single-arm-matchstrictA
matchhas one arm and an empty catch-all arm -
tx0/rust:spawned-thread-detachedstrictA thread or task is spawned and its handle dropped, so its result and panics are never seen
-
tx0/rust:task-commentstrictA comment marks unfinished work
-
tx0/rust:to-string-in-formatstrictAn argument of a formatting macro is converted with
to_string()first -
tx0/rust:too-many-returnsstrictA function has more
returnexpressions than the configured maximum -
tx0/rust:transmute-callstrictmem::transmuteis called -
tx0/rust:transmute-to-static-lifetimestricttransmuteextends a reference's lifetime to'static -
tx0/rust:unit-error-typestrictA public function returns a
Resultwhose error type is() -
tx0/rust:unused-asyncstrictAn
async fncontains no.await -
tx0/rust:unwrap-after-checkstrictA value is unwrapped right after a check that it is present
-
tx0/rust:useless-formatstrictformat!is called with a literal and no arguments -
tx0/rust:weak-key-sizestrictAn RSA, DSA or Diffie-Hellman key is generated with fewer than 2048 bits
-
tx0/rust:wildcard-importstrictA
useimports every name of a module with* -
tx0/rust:zero-index-methodstrictnth(0)orget(0)is called wherenext()orfirst()says it -
tx0/rust:zip-entry-path-traversalstrictThe name of an archive entry is used as a path without checking that it stays in the target directory
: 57 rules
-
tx0/rust:any-for-containsall.iter().any(|x| *x == y)searches a slice for a value, whichcontains(&y)says -
tx0/rust:as-deref-by-handall.as_ref().map(|s| s.as_str())spells out.as_deref() -
tx0/rust:binding-to-wildcardallA pattern
name @ _binds a name to a wildcard, which a plain name does -
tx0/rust:box-new-defaultallBox::new(Default::default())orBox::new(T::new())without arguments isBox::default() -
tx0/rust:char-literal-cast-to-byteallA character literal is cast to
u8, where a byte literal says the same -
tx0/rust:cmp-compared-with-orderingalla.cmp(&b) == Ordering::Lessspells outa < b -
tx0/rust:compared-with-noneallAn
Optionis compared withNoneusing==or!=, whereis_none()andis_some()say it without needingPartialEq -
tx0/rust:comparison-with-plus-oneallx >= y + 1orx - 1 >= yadds one only to turn>into>= -
tx0/rust:default-by-closureallunwrap_or_else(Vec::new)oror_insert_with(Default::default)spells outunwrap_or_default()oror_default() -
tx0/rust:else-after-early-exitallAn
ifbranch ends withreturn,breakorcontinueand is still followed byelse -
tx0/rust:empty-doc-commentallA documentation comment is empty
-
tx0/rust:empty-string-by-conversionallAn empty
Stringis made from""withto_string,to_ownedorString::from, whereString::new()says it -
tx0/rust:err-with-question-markallErr(e)?returns an error through?, wherereturn Err(e.into())says it directly -
tx0/rust:expect-without-messageallexpect("")panics with an empty message, which says less thanunwrap() -
tx0/rust:explicit-iter-in-forallA
forloop calls.iter()or.iter_mut()where&xor&mut xiterates the same -
tx0/rust:extern-crate-itemallextern cratedeclares a dependency that the 2018 edition and later find without it -
tx0/rust:filter-map-then-nextall.filter_map(f).next()is what.find_map(f)does -
tx0/rust:filter-some-then-unwrapall.filter(|x| x.is_some()).map(|x| x.unwrap())is what.flatten()does -
tx0/rust:first-char-comparedalls.chars().next() == Some(c)checks a prefix, whichs.starts_with(c)says directly -
tx0/rust:flatten-by-identity-closureallfilter_map(|x| x)orflat_map(|x| x)passes each element through, whichflatten()does -
tx0/rust:float-literal-too-preciseallA float literal has more digits than its type can hold, so the extra ones are lost
-
tx0/rust:get-then-is-someallmap.get(&k).is_some()asks for a value only to check that the key exists, whichcontains_keysays -
tx0/rust:if-then-panicallif cond { panic!(...) }spells out whatassert!(!cond, ...)does -
tx0/rust:inconsistent-digit-groupingallThe underscores of a number literal split its digits into groups of different sizes
-
tx0/rust:is-digit-radix-tenallc.is_digit(10)checks for an ASCII digit, whichis_ascii_digit()says by name -
tx0/rust:iter-nth-for-getall.iter().nth(i)looks up an element where.get(i)indexes directly -
tx0/rust:len-without-is-emptyallA public type has a public
len()but nois_empty() -
tx0/rust:let-then-returnallA block binds a value with
letonly to return it on the next line -
tx0/rust:literal-format-argumentallA formatting macro is given a literal as an argument, which could be part of the format string
-
tx0/rust:long-literal-without-separatorsallA long integer literal has no
_separators, so its magnitude is hard to read -
tx0/rust:loop-over-indicesallA loop runs over
0..v.len()and only uses the index to readv[i] -
tx0/rust:many-bool-parametersallA function takes three or more
boolparameters, which callers pass as unnamedtrueandfalse -
tx0/rust:map-err-identityallmap_err(|e| e)maps an error to itself -
tx0/rust:map-or-with-boolallmap_or(false, f)ormap_or(true, f)spells outis_some_and(f)oris_none_or(f) -
tx0/rust:map-then-flattenall.map(f).flatten()is what.flat_map(f)or.filter_map(f)does in one step -
tx0/rust:map-to-cloneall.map(|x| x.clone())clones each element where.cloned()says it -
tx0/rust:mixed-case-hex-literalallA hexadecimal literal mixes upper- and lowercase digits
-
tx0/rust:module-named-like-parentallA module contains a module of the same name, as
foo::foo -
tx0/rust:multiply-by-minus-oneallA value is multiplied by -1 where the negation operator says it directly
-
tx0/rust:negated-equalityall!(a == b)or!(a != b)negates a comparison that has a negated form -
tx0/rust:new-without-defaultallA public type has
new()without arguments but does not implementDefault -
tx0/rust:ok-then-unwrapall.ok().unwrap()or.ok().expect()throws away the error thatunwrapwould show -
tx0/rust:pattern-match-only-checksallif let Some(_) = xmatches only to test the variant, whichx.is_some()says -
tx0/rust:println-of-empty-stringallprintln!("")prints an empty string whereprintln!()says it -
tx0/rust:range-check-by-handallx >= a && x < bchecks a range by hand, which(a..b).contains(&x)says directly -
tx0/rust:redundant-field-nameallA struct literal writes
name: namewhere the shorthandnamesays the same -
tx0/rust:replace-option-with-noneallmem::replace(&mut x, None)is whatx.take()does -
tx0/rust:skip-then-nextall.skip(n).next()is what.nth(n)does -
tx0/rust:static-lifetime-in-constallA
constorstaticspells out'staticon a reference, which is implied there -
tx0/rust:string-literal-as-bytesall"text".as_bytes()converts a literal at run time whereb"text"is a byte literal -
tx0/rust:trim-before-split-whitespaceallA string is trimmed before
split_whitespace, which skips leading and trailing whitespace anyway -
tx0/rust:undocumented-errorsallA documented public function returns
Resultbut its documentation has no# Errorssection -
tx0/rust:unit-return-typeallA function declares
-> (), which is the default return type -
tx0/rust:unwrap-or-else-panicallunwrap_or_else(|_| panic!(..))spells out whatexpect(..)does -
tx0/rust:upper-case-acronym-in-nameallA type name writes an acronym in capitals, as
HTTPServer, against Rust's camel case convention -
tx0/rust:while-let-on-iteratorallwhile let Some(x) = iter.next()is what aforloop over the iterator does -
tx0/rust:while-trueallwhile trueis written for an endless loop, whichloopsays