Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)JP
jpfreely @programming.dev
Posts 7
Comments 23

What should the getter for a Vec|String| return, &? What about Option|Vec|String||?

When returning an immutable reference to a private struct field. (On mobile and used vertical bars instead of a bunch of HTML codes)

6

Do you use mod.rs, the module name, or does it vary? How do you decide?

I started off avoiding mod.rs because it's the old way and I prefer having the module name as the filename. However, if the module needs a folder for submodules anyway, then there's a reason to tuck it away as mod.rs, especially if not doing so leaves lots of duplicate names (a.rs, b.rs, c.rs, ..., a/, b/, c/).

But then I don't really like to have much else in mod.rs other than mod declarations and pub use. Maybe a utility fn or a not-unwieldly implementation of struct "Foo", the module's namesake.

8
I created my first crate: cypher-dto
  • Thanks for the feedback.

    • I'll definitely drop the Cypher prefix, and think it's a good idea to at least move the shorthand attribute macros to a crate feature. The readmes would use derive instead of the shorthand mostly.
    • ty::new() just uses the types in the struct (plus &str for String and &[T] for Vec). The extra builder struct is to help with updates, where you may want to just change a couple of fields, or bind it to editable UI fields.

    I didn't realize how strong the rust presence is here. Experienced-devs on reddit is hard to go without :)

  • I created my first crate: cypher-dto

    Hi everyone! I started learning rust about 3 months ago and had a sort of working version of this for my own needs, but spent some time (maybe lots) cleaning it up, testing it, and making it worthy of publishing.

    https://crates.io/crates/cypher-dto

    It's for working with Neo4j (cypher query language). It aims to assist in creating manual queries but provides unitary CRUD operations for nodes and relationships out of the box. Some other niceties:

    Generates new(), getter methods, and a builder struct, and copies doc comments to them.

    Has 'smart' handling of created/updated timestamp fields.

    Supports multi-valued primary keys; uses the term "identifier" for that set of fields.

    2
    How did you mess with school computers?
  • One time we got around the security for a shared windows folder (Win98). Another time a couple of us printed fake midterms for ourselves on official headered paper. But the one that sticks out is this trojan program I got from my older brother called deepthroat. I put it on a couple of other people's computers that I wanted to mess with, and proceeded to open their cd tray, pop up fake warnings/errors, and other random stuff that a friend and I thought was hilarious at the time. It all stopped when I popped up a message that said "Contacting [name]'s parents..." on this girls computer and she got the teacher's attention about it. He knew what was up and scanned all the computers. He was mad but we didn't really get in trouble. We also did the fake desktop screenshot stuff :D

  • This is Annie. She loves feet.

    1
    Why I prefer trunk-based development - Trisha Gee
  • My understanding of trunk based development is that it allows for short lived branches and keeps longer work behind feature flags as it is merged in pieces. The common CI approach with pull/merge requests having to pass tests still applies.

  • How do you measure the business impact of your engineers work?
  • You missed the point that op is trying to help the engineers understand where their work comes from and the effects it has. Giving them or letting them be part of the bigger picture aids in the decision making process when doing the actual engineering.

  • Caught: 2.5 hour documentary voice over: "As of my knowledge cutoff in September 2021"

    Wasn't sure where to post this. It's pretty funny but also sad. As a human, I feel that way.

    7
    I need to buy laptop
  • I returned my $4000 MacBook, I don't like the keyboard layout and thought it had poor performance for the hardware. I would go for a Linux laptop but other than that I prefer Chromebooks and have been using them for 10ish years.

  • I need to buy laptop
  • I would get a higher end Chromebook. They run Linux, have a built in android container, nice keyboards, touch screen, often have 360 hinges if that matters to you.

    I've got the middle one in that pic and it's almost as fast as my 24 core desktop. Like others said, get 16 gig of ram. Edit: i use VS code which is less beastly than Android studio, but there's no need to run an emulator because it's already built in, accelerated.

  • Hi Dart and Flutter people!

    This is c/dart (!dart?). See also c/flutter.

    Edit: there's also https://lemmy.world/c/dartlang

    0

    "installing" web app on chrome Android creates an icon named Lemmy with the mouse icon

    0