Skip to content

[feature] use checked_ilog10 to reduce string allocation #550

@HerringtonDarkholme

Description

@HerringtonDarkholme

⭐ Suggestion

Column width is now computed with string allocation, we can use checked_ilog10 to simplify it.

sg -p '$A.to_string().chars().count()' 
image

💻 Use Cases

sg -p '$A.to_string().chars().count()' -r '$A.checked_ilog10().unwrap_or(0) + 1'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions