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/)LA
larix @programming.dev
Posts 1
Comments 3
since: my first project
  • Well, that explains why it's technically possible.

    As for why Option<&str> is preferrable then: It hides away your internals. Your caller should only care whether they can get the value or not (Some vs. None), not what the precise reason is. That reason or your internal structure might change.

    Yes, that makes sense too. Great!

    I’ve updated the code as recommended.

    @[email protected] @[email protected]

  • since: my first project
  • Thank you very much. I’ll change it. I did run cargo clippy, but it didn’t complained anything anymore before I published the code. 🙂

    One question to return value Option<&String>:

    is it better to change to Option<&str> or &Option<String> if the value in the struct is a Option<String>? The latter sounds more logical to me.

  • since: my first project

    codeberg.org since

    Filter input by timestamp

    since

    This is my first project in rust, called: since. A small tool to filter logfiles or any other files with a timestamp in it, by a given timestamp.

    For example:

    since 1h /var/log/messages prints all lines from the last hour. since 00:00 /var/log/messages prints all lines since 00:00.

    It would be nice if you could take a look at the code. What would you change, what should I change?

    I’m not a professional programmer, this is just a hobby, but I want to learn as much as possible.

    9