Comments (2)
Hi @alexipeck ๐ The problem here is just that we canโt get the actual value of the string at compile time in order to parse it in the macro if itโs not a string literal.
I do think this can still be implemented now though since we have a const parser for UUIDs available to us. Itโs just a limitation of the current macro that needs to be lifted.
from uuid.
I realise now that this has been documented, is there a reason this marco can't support this use case?
Tokens that aren't string literals are also rejected:
let uuid_str: &str = "550e8400e29b41d4a716446655440000";
let uuid = uuid!(uuid_str);
Provides the following compilation error:
error: expected string literal
|
| let uuid = uuid!(uuid_str);
| ^^^^^^^^
from uuid.
Related Issues (20)
- Wrapping behavior of `impl ClockSequence for Context` HOT 4
- Export `error::InvalidUuid` HOT 2
- Make &'a Uuid serializable HOT 3
- UUID no longer supports serde derive attributes HOT 2
- Add bytemuck support HOT 1
- Add `prost::Message` implementation for `Uuid` HOT 3
- v7 should have a counter option? HOT 36
- Macros from 1.5.0 to 1.6.0 break. HOT 4
- Investigate crate size HOT 2
- Idiotmatic naming: drop/replace `get_` prefixes HOT 4
- 1.7.0 breaking change HOT 2
- Initialization of CONTEXT in timestamp::context::shared_context() not thread-safe HOT 1
- the trait Deserialize is not implemented for `Uuid` HOT 2
- TryFrom<Vec<u8>> makes an unnecessary copy HOT 1
- `uuid!` `index is out of bounds` in clippy on rust 1.77 (fixed in uuid 1.6.1)
- Why does Uuid implement Ord, PartialOrd? HOT 1
- Special UUIDv7 function for microservices HOT 1
- Add a macro for generating wrapper types
- Future better UUID binary-to-text encoding
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 uuid.