INDAPlus21 / INDAPlus21/eliased-hash-task-16
Pass
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**Very well done Elias!**
Your application source code is a mess! The program also crashes at unexpected values; not good!
Also, what(?), and it will do twice:
_Your code_:
```rs
fn removeCSV(/*...*/) -> /*...*/ {
//...
let deserialized = rdr.deserialize();
let mut do_once = 0;
for result in deserialized {
if do_once < 2 {
//...
do_once += 1;
}
}
//...
}
```
_Refactorised code_:
```rs
use std::cmp;
fn removeCSV(/*...*/) -> /*...*/ {
//...
let deserialized = rdr.deserialize().iter();
for _ in 0..2 {
match deserialized.next() {
Some(_result) => //...
None => break;
}
}
//...
}
```
_Refactorised (`do_once`) code_:
```rs
use std::cmp;
fn removeCSV(/*...*/) -> /*...*/ {
//...
let deserialized = rdr.deserialize().iter();
if let Some(_result) = deserialized.next() {
//...
}
//...
}
```
Keep it up (with less out-commented code jungle bush)!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the removeCSV function in the repository and read the surrounding deserialization code. Check how it handles unexpected values and whether processing is limited to the intended records; done means the crash and repeated-processing concerns in the issue are addressed and the behavior is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100