Giter Club home page Giter Club logo

Comments (5)

janhohenheim avatar janhohenheim commented on May 22, 2024 1

Aaah I see, fair enough. Consider the review finished in that case :)

from ico-builder.

bash avatar bash commented on May 22, 2024

@janhohenheim

from ico-builder.

janhohenheim avatar janhohenheim commented on May 22, 2024
  • Derive Deref and DerefMut for IconSizes and remove the .0 from sizes.0
  • IMO these lines violate the SRP and should be in their own function
  • Replace the PathBuf::push call with let output_path: PathBuf = [out_dir, file_name].iter().collect();, see the docs
  • Replace the .unwrap calls with .expect with a nice message
  • Rename buf to buffer
  • Move the example in the docs to an actual example
  • What happens when the input images are not squares?
  • Reduce code duplication by making add_source_file call add_source_files
  • IconSizes::new requires 'static input, limiting its usefulness in e.g. GUIs with user input. It uses a Cow internally, so this is unnecessary

from ico-builder.

bash avatar bash commented on May 22, 2024

Thaaanks so much for your review ❤️. You indeed caught some things I have missed :)

I have addressed most of the comments and checked them off the list.

Derive Deref and DerefMut for IconSizes and remove the .0 from sizes.0.

I can only implement Deref as my underlying Cow might be a non-mutable reference :)

  • IconSizes::new requires 'static input, limiting its usefulness in e.g. GUIs with user input. It uses a Cow internally, so this is unnecessary

I only need the Cow so that I can create IconSizes in const contexts. In that case 'static is indeed required.

If you have non-static data, you can use this From impl:

impl<'a, I> From<I> for IconSizes
where
    I: IntoIterator<Item = &'a u32>

from ico-builder.

bash avatar bash commented on May 22, 2024

Oh, I forgot to close this :) Thanks again for the review ❤

from ico-builder.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.