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

todo! keyword support #220

Open
xamgore opened this issue May 13, 2023 · 1 comment
Open

todo! keyword support #220

xamgore opened this issue May 13, 2023 · 1 comment

Comments

@xamgore
Copy link

xamgore commented May 13, 2023

A common approach for writing stubs in Rust programming language is the todo! macro. First, it satisfies the type-checker and makes the code compileable. On the other hand, it calls a panic at runtime while printing the provided message.

fn fibonacci(n: usize) -> usize {
  if n == 0 { 0 } else { todo!("I can't figure out how to implement it now") }
}

So, if a project would like to use PDD during the development, it would be verbose since only three keywords are supported: @todo, TODO and TODO:. I suggest extending this amazing triplet with todo!.

todo!("#234:15m/DEV This is something to do later in one of the next releases.") }

instead of

// TODO #234:15m/DEV This is something to do later in one of the next releases.
todo!() }

As far as I know, @yegor256 does write in Rust, so I would like to hear an opinion from the project's founder.

@yegor256
Copy link
Member

@xamgore sounds like a good idea to me. Would you be willing to submit a pull request with this extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants