Generating colors with Clap v4 and palette

Поділитися
Вставка
  • Опубліковано 26 гру 2024

КОМЕНТАРІ • 16

  • @workflowinmind
    @workflowinmind 2 роки тому +6

    Not sure how you manage to deliver that much good videos almost daily but thanks a lot, I upgraded my CLI yesterday to v4

  • @JeffHanke
    @JeffHanke 2 роки тому +2

    One trick for maximizing type inference with collect() is using '_', e.g.: '.collect::()'. Rust can almost always infer what the element type is. Less typing now, less changes later if you decide to change the element type.

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +4

      very true, thanks for mentioning that.
      I usually treat collect() as an error shortcut point, so instead of inferring I tend to type it so that the type I want is concrete at that location and the errors report with that type rather than having longer inference chains.
      I think this especially helps with a crate like palette, which has a larger than average amount of type aliases that are all effectively Rgb.

    • @JeffHanke
      @JeffHanke 2 роки тому +2

      @@chrisbiscardi If you're specifying the complete type on purpose (instead of just because rust can't infer it), it may make more sense to put it on the variable declaration instead of as a turbofish on the collect() call.

  • @ihgnmah
    @ihgnmah Рік тому

    Thank you for the video. The topic is interesting, and it would be easier to follow if you could do a from-scratch video where you explain the process step by step.

  • @dein-ding
    @dein-ding 2 роки тому +3

    I was thinking about making a litte 'TODO:'-comment scanning cli, that searches a code base and outputs the comments with the file path to click on to start learning go, but I'm kinda tempted to do that with rust now.

    • @dein-ding
      @dein-ding 2 роки тому +1

      btw first time I see one of your videos, very good so far. keep it up mate💪

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +2

      The person that made ripgrep also maintains some useful directory-walking crates and such, like walkdir: docs.rs/walkdir/latest/walkdir/ that would help if you went the Rust route.
      You could even depend on the grep crate from ripgrep's internals (although the internal ripgrep crates are not documented, so it depend on how comfortable you are with Rust and what you want your TODO CLI to do) -- github.com/BurntSushi/ripgrep/blob/master/crates/grep/examples/simplegrep.rs

    • @dein-ding
      @dein-ding 2 роки тому +1

      @@chrisbiscardi I have hardly any experience with rust, just some messing around and playing a little, this would be my first project in it. Thanks for the resources. 😁

  • @alexanderchaplinbraz1113
    @alexanderchaplinbraz1113 2 роки тому

    I noticed at 1:24 that your help output is coloured. That's supposed to be gone in 4.0, so how is that possible? I built the repo and mine comes out monochrome as expected. Is it just your terminal somehow colouring it by itself?

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +2

      yeah, nushell allows me to set colors for a number of things, and I do have some of them set -- www.nushell.sh/book/coloring_and_theming.html

  • @azzamsya
    @azzamsya 2 роки тому +1

    Love your Rust videos. Keep it up 🔥

  • @mammba9335
    @mammba9335 2 роки тому

    Julius Pringles thanksgiving ca early

  • @popgeek503
    @popgeek503 2 роки тому

    thanks mate tNice tutorials was a big help

  • @HagbardCelineOnRust
    @HagbardCelineOnRust 2 роки тому

    sometimes i dream of this zip().map() in typescript :-P

  • @NikolaHristov
    @NikolaHristov 2 роки тому

    GG