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

bar #1

Closed
wants to merge 144 commits into from
Closed

bar #1

wants to merge 144 commits into from

Conversation

Mouvedia
Copy link
Owner

@Mouvedia Mouvedia commented Mar 2, 2024

No description provided.

todo: refaxctor how width/height is passed
Copy link
Owner Author

@Mouvedia Mouvedia left a comment

Choose a reason for hiding this comment

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

J'ai review 40%.
Il me reste src et static.


// try to send to all clients, ignoring failures
// disconnected clients will get swept up by `remove_stale_clients`
let _ = future::join_all(send_futures).await;
Copy link
Owner Author

Choose a reason for hiding this comment

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

topheman added a commit to topheman/snake-pipe-rust that referenced this pull request Mar 2, 2024
topheman added a commit to topheman/snake-pipe-rust that referenced this pull request Mar 3, 2024
Copy link
Owner Author

@Mouvedia Mouvedia left a comment

Choose a reason for hiding this comment

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

30 fichiers sur 50

// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "NodeNext", /* Specify what module code is generated. */
Copy link
Owner Author

Choose a reason for hiding this comment

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

minor

node16 implies --target es2022

Basé sur le .nvmrc et la l12 jte conseillerais de changer pour node16 car ce serait plus en phase avec les recommandations de Microsoft.

package.json Outdated
"name": "snake-pipe-rust",
"version": "0.1.0",
"private": true,
"description": "You only need this part for better experience with js development, not mandadtory.",
Copy link
Owner Author

@Mouvedia Mouvedia Mar 3, 2024

Choose a reason for hiding this comment

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

typos

  • a better ou an easier
  • mandatory

Copy link

Choose a reason for hiding this comment

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

Résolu

Copy link
Owner Author

Choose a reason for hiding this comment

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

pub fn format_version_with_features(
versions_with_features: IndexMap<String, Vec<String>>,
) -> String {
if versions_with_features.len() == 1 {
Copy link
Owner Author

Choose a reason for hiding this comment

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

question

C'est étrange ça, tu gères le else comme si c'était > 1 mais on peut t'en passer un vide, non?

Copy link

Choose a reason for hiding this comment

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

C'est bien == 1. Au cas où il n'y a qu'une seule version, inutile de spécifier les features.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Je veux dire que le code après ce if que je considère comme un else—à cause du return—est géré comme > 1 alors que potentiellement tu pourrais avoir 0.

pub snake_length: u32,
pub size: SizeOption,
pub features_with_version: std::collections::HashMap<String, String>,
pub metadatas: std::collections::HashMap<String, String>,
Copy link
Owner Author

Choose a reason for hiding this comment

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

typo

c'est "uncountable"
metadata

Copy link

Choose a reason for hiding this comment

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

Si tu veux remplacer metadatas par uncountable, il peut y avoir beaucoup de choses dedans.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Si tu veux remplacer metadatas par uncountable

Non je veux dire que le pluriel et le singulier de metadata sont les mêmes.
i.e. metadata ne prend pas de s au pluriel

let _ = crossterm::terminal::enable_raw_mode();
let _ = gamestate_run(game_options); // this function returns when ctrl+c is hit
let _ = crossterm::terminal::disable_raw_mode();
std::process::exit(130); // todo handle other signals ?
Copy link
Owner Author

Choose a reason for hiding this comment

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

minor

magic number
const

None => {
if list {
println!("{}", "List of pipelines:".bold().underline());
generate_command(Some(Pipeline::Play), false, "play");
Copy link
Owner Author

Choose a reason for hiding this comment

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

question

ya un moyen meta de référencer les cases utilisés dans le match ?
ça te permettrait de loop et de pas à avoir à maintenir ce if

topheman added a commit to topheman/snake-pipe-rust that referenced this pull request Mar 3, 2024
topheman added a commit to topheman/snake-pipe-rust that referenced this pull request Mar 6, 2024
Copy link
Owner Author

@Mouvedia Mouvedia left a comment

Choose a reason for hiding this comment

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

54/54

Comment on lines +104 to +110
queue!(
stdout,
cursor::RestorePosition,
terminal::Clear(terminal::ClearType::FromCursorDown),
cursor::Show,
)
.unwrap();
Copy link
Owner Author

Choose a reason for hiding this comment

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

refactor
minor

ça pourrait ptet être une fonction
voir l57

cursor::Show,
)
.unwrap();
std::process::exit(130);
Copy link
Owner Author

Choose a reason for hiding this comment

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

/**
* `<https://en.wikipedia.org/wiki/Box-drawing_character>`
*/
fn render_line_wrapper(width: u32, top: bool) -> String {
Copy link
Owner Author

Choose a reason for hiding this comment

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

minor

  1. Le bool arg me semble être un code smell.
  2. Il serait plus clair d'avoir un let line_corners = et un seul format

Copy link

Choose a reason for hiding this comment

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

Tu peux élaborer ?

Copy link
Owner Author

@Mouvedia Mouvedia Mar 9, 2024

Choose a reason for hiding this comment

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

pour 1. ça vient de clean code—le bouquin—c'est un mauvais signe lorsque un bool arg est utilisé par une fonction ayant plusieurs arguments
e.g. pour un toggler c'est bon

pour 2. le match bool me semble over the top, en gros 2 couples de strings nommées top et bottom permettrait d'avoir qu'un seul call de format

@@ -0,0 +1,90 @@
import { makeRenderInfos } from './utils.js'

const renderInfos = makeRenderInfos(["score", "version"]);
Copy link
Owner Author

Choose a reason for hiding this comment

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

minor

pareil que #1 (comment)
info singulier et pluriel

@Mouvedia Mouvedia closed this Mar 10, 2024
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.

2 participants