rust-practice / cargo-leet

Program to make working on leetcode problems locally more convenient
Apache License 2.0
5 stars 3 forks source link

Incorrectly adding TODO for function body for questions that don't start with a function body #63

Open c-git opened 1 year ago

c-git commented 1 year ago

Describe the bug

In the below example it adds todo!("Fill in body") as if it was a function body but it's not. This is not valid rust code and thus cannot be formatted.

//! Solution for https://leetcode.com/problems/implement-stack-using-queues
//! 225. Implement Stack using Queues

struct MyStack { todo!("Fill in body") }

Leetcode problem

https://leetcode.com/problems/implement-stack-using-queues

To Reproduce

cargo leet gen https://leetcode.com/problems/implement-stack-using-queues

Error Message

N/A

Expected behavior

The todo is not added to the struct body

Environment Info:

Additional context

N/A