Skip to content

Reverse payment list in example CLI app #719

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

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

danielgranhao
Copy link
Collaborator

Now the latest payment appears in the bottom, making it much easier to follow.

@@ -845,7 +845,7 @@ fn list_payments(node: &LightningNode) -> Result<(), String> {
};

println!("Total of {} payments\n", payments.len().to_string().bold());
for payment in payments {
for payment in payments.iter().rev() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do into_iter() then probably you do not need other changes:

Suggested change
for payment in payments.iter().rev() {
for payment in payments.into_iter().rev() {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right 🤦 thanks!

@danielgranhao danielgranhao force-pushed the feature/reverse-payment-list-in-example-app branch from d94bba2 to 681695c Compare October 30, 2023 12:23
@danielgranhao danielgranhao merged commit 3ed21c6 into main Oct 30, 2023
@danielgranhao danielgranhao deleted the feature/reverse-payment-list-in-example-app branch October 30, 2023 12:39
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.

2 participants