Code Monkey home page Code Monkey logo

Comments (1)

daboross avatar daboross commented on September 28, 2024 1

Thank you for opening up this discussion! I'm using your crate, and really satisfied with the functionality. I'd have a bit of input in this, but what it has isn't that bad I'd say - might be slightly confusing with app_dir defaulting to creating something, but then again that is a reasonable default.

I'm not at all sure what the best names would be, but have you seen https://github.com/rust-lang/rfcs/blob/master/text/0356-no-module-prefixes.md? It's a guideline on things in the standard library, but I think it might be a good thing to apply to crates as well.

The ensure_app_dir and compute_app_dir definitely seem better than the current names to me - I certainly can't think of anything better at the moment, but part of me does want to have the methods without 'app' in them.

If I was to come up with names from scratch, I would probably do something like the following (I don't think these would be good to change to now, just giving some input to the discussion of possibilities):

  • get_data_root -> data_root
  • data_root -> create_data_root
  • get_app_root -> dir
  • app_root -> create_dir
  • get_app_dir -> sub_dir
  • app_dir -> create_sub_dir

create_ slightly mirrors what std does with File::create (create a file only if it does not exist).

from app-dirs-rs.

Related Issues (20)

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.