diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index c1e41c8..f935a03 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -17,7 +17,7 @@ env_logger = "0.10.0" clap = { version = "4.0.29", features = ["derive"] } phf_codegen = "0.11.1" once_cell = "1.12.0" -regex = "1.7.1" +fancy-regex = "0.10.0" indicatif = "0.17.0" num_enum = "0.5.7" path_macro = "1.0.0" diff --git a/codegen/src/collect_large_numbers.rs b/codegen/src/collect_large_numbers.rs index 8e90f2a..98d1479 100644 --- a/codegen/src/collect_large_numbers.rs +++ b/codegen/src/collect_large_numbers.rs @@ -2,10 +2,10 @@ use std::collections::{HashMap, HashSet}; use std::{collections::BTreeMap, fs::File, io::BufReader, path::Path}; use anyhow::{Context, Result}; +use fancy_regex::Regex; use futures::{stream, StreamExt}; use once_cell::sync::Lazy; use path_macro::path; -use regex::Regex; use reqwest::{header, Client}; use rustypipe::param::{locale::LANGUAGES, Language}; use serde::Deserialize; @@ -139,6 +139,7 @@ pub fn write_samples_to_dict(project_root: &Path) { .find_map(|(mag, (txt, _))| { let point = POINT_REGEX .captures(txt) + .unwrap() .map(|c| c.get(1).unwrap().as_str()); if let Some(point) = point { diff --git a/codegen/src/gen_dictionary.rs b/codegen/src/gen_dictionary.rs index a932011..70bbca6 100644 --- a/codegen/src/gen_dictionary.rs +++ b/codegen/src/gen_dictionary.rs @@ -1,8 +1,8 @@ use std::fmt::Write; use std::path::Path; +use fancy_regex::Regex; use once_cell::sync::Lazy; -use regex::Regex; use rustypipe::timeago::TimeUnit; use crate::util; @@ -11,7 +11,7 @@ const TARGET_PATH: &str = "src/util/dictionary.rs"; fn parse_tu(tu: &str) -> (u8, Option) { static TU_PATTERN: Lazy = Lazy::new(|| Regex::new(r"^(\d*)(\w?)$").unwrap()); - match TU_PATTERN.captures(tu) { + match TU_PATTERN.captures(tu).unwrap() { Some(cap) => ( cap.get(1).unwrap().as_str().parse().unwrap_or(1), match cap.get(2).unwrap().as_str() { diff --git a/src/client/music_playlist.rs b/src/client/music_playlist.rs index 016b023..664a122 100644 --- a/src/client/music_playlist.rs +++ b/src/client/music_playlist.rs @@ -88,11 +88,7 @@ impl RustyPipeQuery { .collect::>(); if !to_replace.is_empty() { - let mut playlist = self.music_playlist(playlist_id).await?; - playlist - .tracks - .extend_limit(&self, album.tracks.len()) - .await?; + let playlist = self.music_playlist(playlist_id).await?; for (i, title) in to_replace { let found_track = playlist.tracks.items.iter().find_map(|track| {