Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a way to style constants #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

schneems
Copy link
Collaborator

@schneems schneems commented Nov 4, 2024

Issue #16 outlined how the current API is not usable to create const variables.

// Does not work
const DEBUG_INFO: String = bullet_stream::style::important("Debug info:");

This adds a macro that can work with constant declarations. It has caveats outlined in the docs.

const DEBUG_INFO: &str = important_lit!("Debug info:"); 

@schneems schneems force-pushed the schneems/const-ok-important branch from 67f58a3 to 9531860 Compare November 4, 2024 17:21
@schneems schneems marked this pull request as ready for review November 4, 2024 17:23
Issue #16 outlined how the current API is not usable to create const variables.

```rust
// Does not work
const DEBUG_INFO: String = bullet_stream::style::important("Debug info:");
```

This adds a macro that can work with constant declarations. It has caveats outlined in the docs.

```rust
const DEBUG_INFO: &str = important_lit!("Debug info:"); 
```
@schneems schneems force-pushed the schneems/const-ok-important branch from 9531860 to a453fa4 Compare November 4, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant