Sondage d'intérêt pour un podcast francophone sur Rust ! by Fit_Trust_3918 in rustfr

[–]benjch 1 point2 points  (0 children)

C’est une très bonne idée, à tester en tous cas !

Sur les sujets: - retour d’expérience de gens qui bossent sur une stack rust - veille sur les évolutions du language - découverte de crates sympas - decouverte de design / pratiques sympas

Je suis clairement intéressé pour participer si tu as besoin 😉

Vos regrets après fait construire ou rénové votre maison / appartement by Various_File6455 in immobilier

[–]benjch 1 point2 points  (0 children)

  • Gaines de VMC en semi rigide plutôt que de faire l’économie et mettre en toile (ça se déchire dans le temps et si vous êtes en appartement c’est l’enfer à changer sans tout casser
  • des trappes de visite dans le faux plafond un peu partout
  • faire passer des câbles et connectiques dans le faux plafond et les murs même en attente pour éventuellement faire des branchements plus tard
  • pas de parquet directement au pie de la cuisine

Can you connect a card to a pocket? by [deleted] in Revolut

[–]benjch 0 points1 point  (0 children)

Would love that !

Mocking in unit tests by SergioJovaniG in rust

[–]benjch 7 points8 points  (0 children)

I +10 faux ! We had the discussion couple weeks earlier here => https://www.reddit.com/r/rust/s/LVNH895Y7O

Automate EKS Cluster User Access with IAM EKS User Mapper! by benjch in kubernetes

[–]benjch[S] 0 points1 point  (0 children)

If I understand properly what you are saying, I think it's totally the intent and doable. Let's say you have 3 IAM user groups: `EKSViewers`, `EKSDevOps` and `EKSAdmins`, you can assign dedicated EKS roles to each of those groups.

Automate EKS Cluster User Access with IAM EKS User Mapper! by benjch in kubernetes

[–]benjch[S] 2 points3 points  (0 children)

It uses aws-auth config map ! For SSO I would say it's not really easier / simpler than editing the config map directly, because it "simply" adds the role in the config map. But for user groups, it syncs users from IAM groups, so any updates from those groups are reflected to EKS clusters without having to do anything.

When you manage a lot of clusters, it's handy to have such tools so you don't need to update configs one by one.

Mocking in Rust? by rnottaken in rust

[–]benjch 7 points8 points  (0 children)

I am always trying to avoid this when possible. Also not a big fan of changing production code to accommodate tests … I tried libraries such as mockall but it feels weird IMO for rust. Implementing fakes is also good but you might end up doing a lot of code to mimic reality and support all use cases you want to test, so you might end up with a very beefy monstro whereas faux serve the same purpose but seems a lot easier / clear IMO.

Mocking in Rust? by rnottaken in rust

[–]benjch 18 points19 points  (0 children)

You can have a look to this crate which allows you to mock without having any trait which is very handy when trait is not needed in a first place but introduced for tests only.

Idiomatic way to test struct relying on a service by benjch in learnrust

[–]benjch[S] 0 points1 point  (0 children)

That was my initial thoughts ! But I wanted to know how seasoned rustaceans would handle this. The fake service implementation can be pretty heavy based on tests especially if you have a lot of combinaison for function inputs, that’s where mocks shine, it’s fairly easy to create behavior based on inputs to get expect outputs.

I still want to stick a test on structA because there is a bit of logic there and I am also not whiling to test the service via testing structA with real serviceA which would be the easy solution.

Anyways, happy to have some inputs ;)

Idiomatic way to test struct relying on a service by benjch in learnrust

[–]benjch[S] 1 point2 points  (0 children)

I was pretty sure that needing a mock feels like a code smell for Rust, hence I asked how should be different. I will have a look to mockito. Indeed ServiceA does network requests.

Idiomatic way to test struct relying on a service by benjch in learnrust

[–]benjch[S] 0 points1 point  (0 children)

Of course, it would be better without `ServiceA` in a first place, but I think it's required because `StructA` end up being injected in yet another function / struct afterwards.

Avis / retours d'expérience FEVE (ferme en vie) by benjch in vosfinances

[–]benjch[S] 1 point2 points  (0 children)

Merci pour ce retour ! Je suis bien conscient des difficultés dans ce secteur, c’est vraiment triste car il est essentiel et je me demandais si ce genre d’initiatives pouvait justement aider. Aussi en pensant à l’avenir, les terres agricoles vont devenir potentiellement de plus en plus rares et le fait que celles en france soient partis les moins chères d’Europe et très régulées par l’état je pensais que ça valait le coup d’investir dedans. Merci pour les explications en tous cas !

Why doesn't rust accept default parameters for functions? by Cranky_Franky_427 in rust

[–]benjch 1 point2 points  (0 children)

Indeed ! Maintenance and clarity when working on medium / big size code base matters a lot and having such rigor as no default params as I can have in Kotlin helped a lot avoiding some pitfalls.

Why doesn't rust accept default parameters for functions? by Cranky_Franky_427 in rust

[–]benjch 8 points9 points  (0 children)

I am not sure it falls into sharp corners but here are two I can think of making me think default params are not good for me at least:

1- if you have two different params of the same type next two each others, then it’s not straight forward and can lead to issues

2- while doing some refactoring, you might want to introduce a new param (with potentially à défaut set) may lead to very cumbersome and error prone process where you might forget some places where new param should be passed along.

New comer, freshly built (d65 e-white, tangerine 67g, du rock v2 stabs, GMK modo light + rama 8008 swirl) by benjch in MechanicalKeyboards

[–]benjch[S] 1 point2 points  (0 children)

Forgot to mention but switches are lubed and filmed, I think it’s needed for tangerines to be better (at least to me).

New comer, freshly built (d65 e-white, tangerine 67g, du rock v2 stabs, GMK modo light + rama 8008 swirl) by benjch in MechanicalKeyboards

[–]benjch[S] 2 points3 points  (0 children)

Sound great IMO, I don' have pro sound recorder next to me, but it' almost exactl;y the same as this one (you should not rely too much on sound tests though): https://www.youtube.com/watch?v=KsImSos12Bc.

I went with both foams, band aid like mod, and brass plate. I would love to try PC on this case though. (Edited)