使用Rust的Iterator优雅解决FizzBuzz问题

1 前言 按照维基百科的说法,FizzBuzz问题 是一个简单但是常见的面试编程问题(可能以前常见,现在都是考Leetcode了,这种连Easy 都...

九月 18, 2024 · 4 分钟 · 1692 字 · Ramsay Leung

Rust模拟C++的函数重载

1 函数重载(function overloading) 所谓的函数重载,指的是某些语言支持创建函数名相同,但函数签名不同的多个函数,所谓的函数签名,既指参数类型,也指...

八月 30, 2024 · 2 分钟 · 827 字 · Ramsay Leung

RSpotify: 一个用爱发电五年的开源项目

1 前言 一周前看到个新闻,Spotify在其第四季度财报中披露,截至2022年12月31日,它的付费订阅用户数达到了2.05亿,同比增长14%...

二月 7, 2023 · 11 分钟 · 5329 字 · Ramsay Leung

一个用爱发电五年的开源项目

1 前言 一周前看到个新闻,Spotify在其第四季度财报中披露,截至2022年12月31日,它的付费订阅用户数达到了2.05亿,同比增长14%...

二月 7, 2023 · 11 分钟 · 5329 字 · Ramsay Leung

Let's make everything iterable

Iterate through pagination in the Rest API 1 Preface About 4 months ago, icewind1991 created an exciting PR that adding Stream/Iterator based versions of methods with paginated results, which makes enpoints in Rspotify more much ergonomic to use, and Mario completed this PR. In order to know what this PR brought to us, we have to go back to the orignal story, the paginated results in Spotify’s Rest API. 2 Orignal Story Taking the artist_albums as example, it gets Spotify catalog information about an artist’s albums....

四月 29, 2021 · 5 分钟 · 1004 字 · Ramsay Leung