Comments (4)
The main hurdle I see is that the new const SIZE
parameter must be usize
since it can't be casted later to u8
, so if there has to be a 255 limit it may have to be checked dynamically.
from arraystring.
The main problem of using arrays of const generic size, is that we must use usize
everywhere, since casting from the generic argument is not allowed yet. That in turn increases the minimum size of ArrayString from 1 byte to 4 bytes in 64-bit systems. 16 bytes minimum.
The crate would therefore become less useful for small sized static strings, which I believe is the most important usecase.
I'm closing this. Until the necessary ability to cast const generic attributes arrives to stable I don't think there's a better solution that the current one.
from arraystring.
Somehow I only got notified about this issue today.
The maximum size is not a restriction and I'm open to those changes. But honestly, I haven't put a thought into this crate in a couple of years.
So if you can provide a PR with the changes I'm willing to review and accept it.
typenum and having to manually implement the trait for each of its types slows compilation down heavily, so removing it would be great.
from arraystring.
Ok, i did suggest something but it depended on generic const expr which is still unstable. Even if the size is > 255, all operation sizes are runtype checked anyway so if N > 255 it's just gonne fail at runtime like if it was N = 255.
from arraystring.
Related Issues (7)
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 arraystring.