devlog250303

> Log Date: 250303

250303 ### Rust, APIs, and the Joy of Debugging


Tasks Completed

1. Terminal & Zsh Workflow Enhancements

2. Rust Installation & First Project Setup


3. Spotify Playlist Generator - API Integration & Debugging


Quick Tip: Avoiding Full Recompiles for Faster Rust Updates

During testing, we noticed that running cargo run every time to test code changes was painfully slow because it was re-compiling everything from scratch. The workaround? Use Rust’s built-in incremental compilation features!

What was happening?

By default, Rust compiles the entire project before running, which is great for performance but frustrating during active debugging. The process slowed us down, especially with API calls requiring multiple iterations to troubleshoot errors.

The Fix: Use cargo check & cargo watch

Instead of running cargo run for every test, we switched to:

1. cargo check – Fast Compilation Without Running

cargo check

2. cargo watch – Auto-Recompilation on File Save

cargo install cargo-watch  # One-time setup
cargo watch -x run

Outcome:

Switching to cargo check and cargo watch significantly reduced debugging time, making iteration smoother while working through Spotify API issues.


Git Journal Entry - March 3, 2025

Commit Message:

"Optimized Zsh setup, installed Rust, and built first API connection for the Spotify playlist generator. Fixed incremental compilation issues."

Detailed Log:

Today, I streamlined my terminal workflow, ensuring Zsh is set up for peak efficiency. This included improving history search, adding plugins for quick navigation, and optimizing command completion. These small changes make a big difference in workflow speed.

On the development side, Rust is fully installed and configured, and I started my first Rust-based API project: a Spotify playlist generator. The main challenge was handling authentication and structuring API requests in Rust, but I got it working after some deep dives into reqwest and serde_json.

During debugging, I realized Rust’s full recompilation process was slowing things down. Implementing cargo check for faster error-checking and cargo watch -x run for automatic recompilation made a huge difference in workflow speed.

Troubleshooting highlights:
- Adjusted Rust structs to properly handle JSON responses.
- Resolved SSL issues in reqwest.
- Fixed empty API responses by refining request parameters.
- Improved debugging efficiency by reducing unnecessary full rebuilds.

Current Roadblock:
- Final API response handling is throwing errors.
- Still working on refining how the data is structured before rendering.

Overall, a solid foundation is now in place for both Rust development and DevOps workflow.


Next Steps for Tomorrow:


Final Thoughts:

Rust is proving to be a powerful but meticulous language. Learning how to streamline debugging and reduce compilation time made a huge difference today. The Spotify API project is taking shape, and even though there’s still an error in the final response parsing, the overall progress has been solid. Excited to solve the last issue and move forward with cleaner, more efficient Rust workflows!