Comments (4)
We should probably provide both panicking and Result-returning versions of the function - maybe change read_str
to expect_str
and add a result-returning read_str
?
If you're okay with that change, I'm happy to submit a pull request to both this and the xmas-elf crate.
That would be great thanks!
from zero.
In my forks, I have transformed it to Result-only since that's what I needed. I can submit a pull request and then someone else could add back in / create the expect versions. Or if I have time tomorrow I'll just add back in the panicking version too.
The one thing I don't love about my version is that is returns a Result where the Err type is &'static str
instead of Utf8Error
, which would be preferable imo. You can't create a Utf8Error object, so I couldn't figure out an easy way to return one.
from zero.
I'd prefer not to make a breaking change if we could avoid it (I realise my earlier proposal is breaking, but perhaps there is a naming scheme which is not).
If we're going to start using Result
we should do it properly and introduce our own error type and use that rather than a string.
from zero.
Agreed. Quite busy this week, but once I get a spare moment I can refactor my forks into a non-breaking naming scheme, and then submit a pull request for each.
from zero.
Related Issues (2)
- Travis not activated HOT 1
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 zero.