Comments (3)
This would be a good case for optional parameters in Rust.
from zxcvbn-rs.
I'm not sure that I agree that this would be cleaner. I feel that having one exported function makes the interface and its options obvious straight away, and makes it easy to switch between having user inputs or not (by having an empty slice).
from zxcvbn-rs.
I can see your reasoning as well. My thinking was, what would a user that didn't know the library well expect the following statement to do:
let password_quality = zxcvbn("password", &[]);
I would expect the first parameter to be the password to be tested, and be right. However, I wouldn't know the meaning of the second parameter without looking at the documentation. This means I'd have to read up on it to understand the code even if I didn't use the parameter myself. Separating the functions mitigates this, and it has the additional advantage of conveying the meaning of the second parameter if I do want to use it.
Anyway, it's not a big thing, so if you disagree I'm fine with closing the issue.
from zxcvbn-rs.
Related Issues (20)
- Unit test failure HOT 1
- Does not build with Rust 1.36.0 HOT 3
- Performance and ideomatic code HOT 4
- release wasm + asm.js version on npm HOT 3
- Rework matching HOT 1
- Feedback and related subtypes don't derive deserialise HOT 4
- Contact for potential security issue HOT 1
- Reevaluate using builders HOT 1
- Change the structure of Match
- Always adds wasm dependencies HOT 5
- breaking change to error type
- Please consider allowing developers to choose a list of matchers
- Some of the Output doesn't match the original library HOT 2
- Allow building with frequency lists outside of the source code. HOT 2
- Is it still true that only ASCII is supported? HOT 2
- Please consider publishing a new release HOT 2
- Build broken on wasm targets
- DOS Exploit HOT 4
- Panic - attempt to multiple with overflow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zxcvbn-rs.