fix: v1.67 clippy lints (inline format strings)
This commit is contained in:
parent
15dad0c428
commit
331a13568a
33 changed files with 200 additions and 288 deletions
|
|
@ -510,7 +510,7 @@ mod tests {
|
|||
#[case::shorts("shorts", "UCh8gHdtzO2tXd593_bjErWg")]
|
||||
#[case::livestreams("livestreams", "UC2DjFE7Xf11URZqWBigcVOQ")]
|
||||
fn map_channel_videos(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "channel" / format!("channel_{}.json", name));
|
||||
let json_path = path!("testfiles" / "channel" / format!("channel_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let channel: response::Channel =
|
||||
|
|
@ -525,11 +525,11 @@ mod tests {
|
|||
);
|
||||
|
||||
if name == "videos_upcoming" {
|
||||
insta::assert_ron_snapshot!(format!("map_channel_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_channel_{name}"), map_res.c, {
|
||||
".content.items[1:].publish_date" => "[date]",
|
||||
});
|
||||
} else {
|
||||
insta::assert_ron_snapshot!(format!("map_channel_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_channel_{name}"), map_res.c, {
|
||||
".content.items[].publish_date" => "[date]",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ impl RustyPipeQuery {
|
|||
reporter.report(&report);
|
||||
}
|
||||
|
||||
Err(ExtractionError::InvalidData(
|
||||
format!("could not deserialize xml: {}", e).into(),
|
||||
Err(
|
||||
ExtractionError::InvalidData(format!("could not deserialize xml: {e}").into())
|
||||
.into(),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,8 +130,6 @@ impl Default for RequestYT {
|
|||
#[derive(Clone, Debug, Serialize, Default)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct User {
|
||||
// TODO: provide a way to enable restricted mode with:
|
||||
// "enableSafetyMode": true
|
||||
locked_safety_mode: bool,
|
||||
}
|
||||
|
||||
|
|
@ -926,8 +924,7 @@ impl RustyPipeQuery {
|
|||
.inner
|
||||
.http
|
||||
.post(format!(
|
||||
"{}{}?key={}{}",
|
||||
YOUTUBEI_V1_URL, endpoint, DESKTOP_API_KEY, DISABLE_PRETTY_PRINT_PARAMETER
|
||||
"{YOUTUBEI_V1_URL}{endpoint}?key={DESKTOP_API_KEY}{DISABLE_PRETTY_PRINT_PARAMETER}"
|
||||
))
|
||||
.header(header::ORIGIN, "https://www.youtube.com")
|
||||
.header(header::REFERER, "https://www.youtube.com")
|
||||
|
|
@ -942,11 +939,7 @@ impl RustyPipeQuery {
|
|||
.inner
|
||||
.http
|
||||
.post(format!(
|
||||
"{}{}?key={}{}",
|
||||
YOUTUBE_MUSIC_V1_URL,
|
||||
endpoint,
|
||||
DESKTOP_MUSIC_API_KEY,
|
||||
DISABLE_PRETTY_PRINT_PARAMETER
|
||||
"{YOUTUBE_MUSIC_V1_URL}{endpoint}?key={DESKTOP_MUSIC_API_KEY}{DISABLE_PRETTY_PRINT_PARAMETER}"
|
||||
))
|
||||
.header(header::ORIGIN, "https://music.youtube.com")
|
||||
.header(header::REFERER, "https://music.youtube.com")
|
||||
|
|
@ -961,8 +954,7 @@ impl RustyPipeQuery {
|
|||
.inner
|
||||
.http
|
||||
.post(format!(
|
||||
"{}{}?key={}{}",
|
||||
YOUTUBEI_V1_URL, endpoint, DESKTOP_API_KEY, DISABLE_PRETTY_PRINT_PARAMETER
|
||||
"{YOUTUBEI_V1_URL}{endpoint}?key={DESKTOP_API_KEY}{DISABLE_PRETTY_PRINT_PARAMETER}"
|
||||
))
|
||||
.header(header::ORIGIN, "https://www.youtube.com")
|
||||
.header(header::REFERER, "https://www.youtube.com")
|
||||
|
|
@ -973,11 +965,7 @@ impl RustyPipeQuery {
|
|||
.inner
|
||||
.http
|
||||
.post(format!(
|
||||
"{}{}?key={}{}",
|
||||
YOUTUBEI_V1_GAPIS_URL,
|
||||
endpoint,
|
||||
ANDROID_API_KEY,
|
||||
DISABLE_PRETTY_PRINT_PARAMETER
|
||||
"{YOUTUBEI_V1_GAPIS_URL}{endpoint}?key={ANDROID_API_KEY}{DISABLE_PRETTY_PRINT_PARAMETER}"
|
||||
))
|
||||
.header(
|
||||
header::USER_AGENT,
|
||||
|
|
@ -992,8 +980,7 @@ impl RustyPipeQuery {
|
|||
.inner
|
||||
.http
|
||||
.post(format!(
|
||||
"{}{}?key={}{}",
|
||||
YOUTUBEI_V1_GAPIS_URL, endpoint, IOS_API_KEY, DISABLE_PRETTY_PRINT_PARAMETER
|
||||
"{YOUTUBEI_V1_GAPIS_URL}{endpoint}?key={IOS_API_KEY}{DISABLE_PRETTY_PRINT_PARAMETER}"
|
||||
))
|
||||
.header(
|
||||
header::USER_AGENT,
|
||||
|
|
@ -1065,7 +1052,7 @@ impl RustyPipeQuery {
|
|||
let report = Report {
|
||||
info: Default::default(),
|
||||
level,
|
||||
operation: format!("{}({})", operation, id),
|
||||
operation: format!("{operation}({id})"),
|
||||
error,
|
||||
msgs,
|
||||
deobf_data: deobf.map(Deobfuscator::get_data),
|
||||
|
|
@ -1230,7 +1217,6 @@ mod tests {
|
|||
fn t_get_ytm_visitor_data() {
|
||||
let rp = RustyPipe::new();
|
||||
let visitor_data = tokio_test::block_on(rp.get_ytm_visitor_data()).unwrap();
|
||||
dbg!(&visitor_data);
|
||||
assert!(visitor_data.ends_with("%3D"));
|
||||
assert_eq!(visitor_data.len(), 32)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -380,13 +380,12 @@ mod tests {
|
|||
#[case::no_artist("no_artist", "UCh8gHdtzO2tXd593_bjErWg")]
|
||||
#[case::only_more_singles("only_more_singles", "UC0aXrjVxG5pZr99v77wZdPQ")]
|
||||
fn map_music_artist(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "music_artist" / format!("artist_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_artist" / format!("artist_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let mut album_page_paths = Vec::new();
|
||||
for i in 1..=2 {
|
||||
let json_path =
|
||||
path!("testfiles" / "music_artist" / format!("artist_{}_{}.json", name, i));
|
||||
let json_path = path!("testfiles" / "music_artist" / format!("artist_{name}_{i}.json"));
|
||||
if !json_path.exists() {
|
||||
break;
|
||||
}
|
||||
|
|
@ -421,7 +420,7 @@ mod tests {
|
|||
artist.albums.append(&mut map_res.c);
|
||||
}
|
||||
|
||||
insta::assert_ron_snapshot!(format!("map_music_artist_{}", name), artist);
|
||||
insta::assert_ron_snapshot!(format!("map_music_artist_{name}"), artist);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -458,7 +457,7 @@ mod tests {
|
|||
ExtractionError::Redirect(id) => {
|
||||
assert_eq!(id, "UCOR4_bSVIXPsGa4BbCSt60Q")
|
||||
}
|
||||
_ => panic!("error: {}", e),
|
||||
_ => panic!("error: {e}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ mod tests {
|
|||
#[case::default("global")]
|
||||
#[case::us("US")]
|
||||
fn map_music_charts(#[case] name: &str) {
|
||||
let filename = format!("testfiles/music_charts/charts_{}.json", name);
|
||||
let filename = format!("testfiles/music_charts/charts_{name}.json");
|
||||
let json_path = Path::new(&filename);
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
|
|
@ -167,6 +167,6 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_charts_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_charts_{name}"), map_res.c);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ mod tests {
|
|||
#[case::mv("mv", "ZeerrnuLi5E")]
|
||||
#[case::track("track", "7nigXQS1Xb0")]
|
||||
fn map_music_details(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "music_details" / format!("details_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_details" / format!("details_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let details: response::MusicDetails =
|
||||
|
|
@ -414,14 +414,14 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_details_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_details_{name}"), map_res.c);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case::mv("mv", "RDAMVMZeerrnuLi5E")]
|
||||
#[case::track("track", "RDAMVM7nigXQS1Xb0")]
|
||||
fn map_music_radio(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "music_details" / format!("radio_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_details" / format!("radio_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let radio: response::MusicDetails =
|
||||
|
|
@ -434,7 +434,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_radio_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_radio_{name}"), map_res.c);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ mod tests {
|
|||
#[case::default("default", "ggMPOg1uX1lMbVZmbzl6NlJ3")]
|
||||
#[case::mood("mood", "ggMPOg1uX1JOQWZFeDByc2Jm")]
|
||||
fn map_music_genre(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "music_genres" / format!("genre_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_genres" / format!("genre_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let playlist: response::MusicGenre =
|
||||
|
|
@ -249,6 +249,6 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_genre_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_genre_{name}"), map_res.c);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ mod tests {
|
|||
#[rstest]
|
||||
#[case::default("default")]
|
||||
fn map_music_new_albums(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "music_new" / format!("albums_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_new" / format!("albums_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let new_albums: response::MusicNew =
|
||||
|
|
@ -103,13 +103,13 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_new_albums_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_new_albums_{name}"), map_res.c);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case::default("default")]
|
||||
fn map_music_new_videos(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "music_new" / format!("videos_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_new" / format!("videos_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let new_albums: response::MusicNew =
|
||||
|
|
@ -122,6 +122,6 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_new_videos_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_new_videos_{name}"), map_res.c);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ impl RustyPipeQuery {
|
|||
let context = self.get_context(ClientType::DesktopMusic, true, None).await;
|
||||
let request_body = QBrowse {
|
||||
context,
|
||||
browse_id: &format!("VL{}", playlist_id),
|
||||
browse_id: &format!("VL{playlist_id}"),
|
||||
};
|
||||
|
||||
self.execute_request::<response::MusicPlaylist, _, _>(
|
||||
|
|
@ -129,8 +129,7 @@ impl MapResponse<MusicPlaylist> for response::MusicPlaylist {
|
|||
if let Some(playlist_id) = shelf.playlist_id {
|
||||
if playlist_id != id {
|
||||
return Err(ExtractionError::WrongResult(format!(
|
||||
"got wrong playlist id {}, expected {}",
|
||||
playlist_id, id
|
||||
"got wrong playlist id {playlist_id}, expected {id}"
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
@ -384,7 +383,7 @@ mod tests {
|
|||
#[case::long("long", "PL5dDx681T4bR7ZF1IuWzOv1omlRbE7PiJ")]
|
||||
#[case::nomusic("nomusic", "PL1J-6JOckZtE_P9Xx8D3b2O6w0idhuKBe")]
|
||||
fn map_music_playlist(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "music_playlist" / format!("playlist_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_playlist" / format!("playlist_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let playlist: response::MusicPlaylist =
|
||||
|
|
@ -397,7 +396,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_playlist_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_music_playlist_{name}"), map_res.c, {
|
||||
".last_update" => "[date]"
|
||||
});
|
||||
}
|
||||
|
|
@ -409,7 +408,7 @@ mod tests {
|
|||
#[case::description("description", "MPREb_PiyfuVl6aYd")]
|
||||
#[case::unavailable("unavailable", "MPREb_AzuWg8qAVVl")]
|
||||
fn map_music_album(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "music_playlist" / format!("album_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_playlist" / format!("album_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let playlist: response::MusicPlaylist =
|
||||
|
|
@ -422,6 +421,6 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_music_album_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_album_{name}"), map_res.c);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ mod tests {
|
|||
#[case::typo("typo")]
|
||||
#[case::radio("radio")]
|
||||
fn map_music_search_main(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "music_search" / format!("main_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_search" / format!("main_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let search: response::MusicSearch =
|
||||
|
|
@ -405,7 +405,7 @@ mod tests {
|
|||
map_res.warnings
|
||||
);
|
||||
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_main_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_main_{name}"), map_res.c);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
|
|
@ -414,7 +414,7 @@ mod tests {
|
|||
#[case::videos("videos")]
|
||||
#[case::no_artist_link("no_artist_link")]
|
||||
fn map_music_search_tracks(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "music_search" / format!("tracks_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_search" / format!("tracks_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let search: response::MusicSearch =
|
||||
|
|
@ -428,7 +428,7 @@ mod tests {
|
|||
map_res.warnings
|
||||
);
|
||||
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_tracks_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_tracks_{name}"), map_res.c);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -473,7 +473,7 @@ mod tests {
|
|||
#[case::ytm("ytm")]
|
||||
#[case::community("community")]
|
||||
fn map_music_search_playlists(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "music_search" / format!("playlists_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_search" / format!("playlists_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let search: response::MusicSearch =
|
||||
|
|
@ -487,14 +487,14 @@ mod tests {
|
|||
map_res.warnings
|
||||
);
|
||||
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_playlists_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_playlists_{name}"), map_res.c);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case::default("default")]
|
||||
#[case::empty("empty")]
|
||||
fn map_music_search_suggestion(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "music_search" / format!("suggestion_{}.json", name));
|
||||
let json_path = path!("testfiles" / "music_search" / format!("suggestion_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let suggestion: response::MusicSearchSuggestion =
|
||||
|
|
@ -508,6 +508,6 @@ mod tests {
|
|||
map_res.warnings
|
||||
);
|
||||
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_suggestion_{}", name), map_res.c);
|
||||
insta::assert_ron_snapshot!(format!("map_music_search_suggestion_{name}"), map_res.c);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_{name}"), map_res.c, {
|
||||
".items.*.publish_date" => "[date]",
|
||||
});
|
||||
}
|
||||
|
|
@ -385,7 +385,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_{}", name), paginator);
|
||||
insta::assert_ron_snapshot!(format!("map_{name}"), paginator);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
|
|
@ -408,7 +408,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_{}", name), paginator);
|
||||
insta::assert_ron_snapshot!(format!("map_{name}"), paginator);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
|
|
@ -429,6 +429,6 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_{}", name), paginator);
|
||||
insta::assert_ron_snapshot!(format!("map_{name}"), paginator);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ impl RustyPipeQuery {
|
|||
playback_context: Some(QPlaybackContext {
|
||||
content_playback_context: QContentPlaybackContext {
|
||||
signature_timestamp: deobf.get_sts(),
|
||||
referer: format!("https://www.youtube.com/watch?v={}", video_id),
|
||||
referer: format!("https://www.youtube.com/watch?v={video_id}"),
|
||||
},
|
||||
}),
|
||||
cpn: None,
|
||||
|
|
@ -374,7 +374,7 @@ fn map_url(
|
|||
util::url_to_params(url),
|
||||
MapResult {
|
||||
c: None,
|
||||
warnings: vec![format!("Could not parse url `{}`", url)]
|
||||
warnings: vec![format!("Could not parse url `{url}`")]
|
||||
}
|
||||
),
|
||||
None => match signature_cipher {
|
||||
|
|
@ -384,8 +384,7 @@ fn map_url(
|
|||
return MapResult {
|
||||
c: None,
|
||||
warnings: vec![format!(
|
||||
"Could not deobfuscate signatureCipher `{}`: {}",
|
||||
signature_cipher, e
|
||||
"Could not deobfuscate signatureCipher `{signature_cipher}`: {e}"
|
||||
)],
|
||||
};
|
||||
}
|
||||
|
|
@ -403,8 +402,7 @@ fn map_url(
|
|||
let mut throttled = false;
|
||||
deobf_nsig(&mut url_params, deobf, last_nsig).unwrap_or_else(|e| {
|
||||
warnings.push(format!(
|
||||
"Could not deobfuscate nsig (params: {:?}): {}",
|
||||
url_params, e
|
||||
"Could not deobfuscate nsig (params: {url_params:?}): {e}"
|
||||
));
|
||||
throttled = true;
|
||||
});
|
||||
|
|
@ -416,8 +414,7 @@ fn map_url(
|
|||
MapResult {
|
||||
c: None,
|
||||
warnings: vec![format!(
|
||||
"url could not be joined. url: `{}` params: {:?}",
|
||||
url_base, url_params
|
||||
"url could not be joined. url: `{url_base}` params: {url_params:?}"
|
||||
)],
|
||||
}
|
||||
)
|
||||
|
|
@ -636,7 +633,7 @@ mod tests {
|
|||
#[case::android("android")]
|
||||
#[case::ios("ios")]
|
||||
fn map_player_data(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "player" / format!("{}_video.json", name));
|
||||
let json_path = path!("testfiles" / "player" / format!("{name}_video.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let resp: response::Player = serde_json::from_reader(BufReader::new(json_file)).unwrap();
|
||||
|
|
@ -650,7 +647,7 @@ mod tests {
|
|||
map_res.warnings
|
||||
);
|
||||
let is_desktop = name == "desktop" || name == "desktopmusic";
|
||||
insta::assert_ron_snapshot!(format!("map_player_data_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_player_data_{name}"), map_res.c, {
|
||||
".details.publish_date" => insta::dynamic_redaction(move |value, _path| {
|
||||
if is_desktop {
|
||||
assert!(value.as_str().unwrap().starts_with("2019-05-30T00:00:00"));
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ impl RustyPipeQuery {
|
|||
let context = self.get_context(ClientType::Desktop, true, None).await;
|
||||
let request_body = QBrowse {
|
||||
context,
|
||||
browse_id: &format!("VL{}", playlist_id),
|
||||
browse_id: &format!("VL{playlist_id}"),
|
||||
};
|
||||
|
||||
self.execute_request::<response::Playlist, _, _>(
|
||||
|
|
@ -145,8 +145,7 @@ impl MapResponse<Playlist> for response::Playlist {
|
|||
let playlist_id = header.playlist_header_renderer.playlist_id;
|
||||
if playlist_id != id {
|
||||
return Err(ExtractionError::WrongResult(format!(
|
||||
"got wrong playlist id {}, expected {}",
|
||||
playlist_id, id
|
||||
"got wrong playlist id {playlist_id}, expected {id}"
|
||||
)));
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +242,7 @@ mod tests {
|
|||
#[case::long("long", "PL5dDx681T4bR7ZF1IuWzOv1omlRbE7PiJ")]
|
||||
#[case::nomusic("nomusic", "PL1J-6JOckZtE_P9Xx8D3b2O6w0idhuKBe")]
|
||||
fn map_playlist_data(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path = path!("testfiles" / "playlist" / format!("playlist_{}.json", name));
|
||||
let json_path = path!("testfiles" / "playlist" / format!("playlist_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let playlist: response::Playlist =
|
||||
|
|
@ -255,7 +254,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_playlist_data_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_playlist_data_{name}"), map_res.c, {
|
||||
".last_update" => "[date]"
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -533,7 +533,7 @@ impl MusicListMapper {
|
|||
// Track
|
||||
Some((MusicPageType::Track { is_video }, id)) => {
|
||||
let title =
|
||||
title.ok_or_else(|| format!("track {}: could not get title", id))?;
|
||||
title.ok_or_else(|| format!("track {id}: could not get title"))?;
|
||||
|
||||
let (artists_p, album_p, duration_p) = match item.flex_column_display_style
|
||||
{
|
||||
|
|
@ -549,7 +549,7 @@ impl MusicListMapper {
|
|||
} else {
|
||||
let mut subtitle_parts = c2
|
||||
.ok_or_else(|| {
|
||||
format!("track {}: could not get subtitle", id)
|
||||
format!("track {id}: could not get subtitle")
|
||||
})?
|
||||
.renderer
|
||||
.text
|
||||
|
|
@ -649,7 +649,7 @@ impl MusicListMapper {
|
|||
.into_iter();
|
||||
|
||||
let title =
|
||||
title.ok_or_else(|| format!("track {}: could not get title", id))?;
|
||||
title.ok_or_else(|| format!("track {id}: could not get title"))?;
|
||||
|
||||
let subtitle_p1 = subtitle_parts.next();
|
||||
let subtitle_p2 = subtitle_parts.next();
|
||||
|
|
@ -812,8 +812,7 @@ impl MusicListMapper {
|
|||
}
|
||||
_ => {
|
||||
return Err(format!(
|
||||
"could not parse subtitle of album {}",
|
||||
id
|
||||
"could not parse subtitle of album {id}"
|
||||
));
|
||||
}
|
||||
};
|
||||
|
|
@ -1057,7 +1056,7 @@ mod tests {
|
|||
atype_samples.iter().for_each(|(lang, entry)| {
|
||||
entry.iter().for_each(|(album_type, txt)| {
|
||||
let res = map_album_type(txt, *lang);
|
||||
assert_eq!(res, *album_type, "lang: {}, txt: {}", lang, txt);
|
||||
assert_eq!(res, *album_type, "lang: {lang}, txt: {txt}");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ mod tests {
|
|||
#[case::empty("empty")]
|
||||
#[case::ab3_channel_handles("20221121_AB3_channel_handles")]
|
||||
fn t_map_search(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "search" / format!("{}.json", name));
|
||||
let json_path = path!("testfiles" / "search" / format!("{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let search: response::Search = serde_json::from_reader(BufReader::new(json_file)).unwrap();
|
||||
|
|
@ -159,7 +159,7 @@ mod tests {
|
|||
map_res.warnings
|
||||
);
|
||||
|
||||
insta::assert_ron_snapshot!(format!("map_search_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_search_{name}"), map_res.c, {
|
||||
".items.items.*.publish_date" => "[date]",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ impl RustyPipeQuery {
|
|||
// YouTube Music album has to be resolved by the YTM API
|
||||
if resolve_albums && id.starts_with(util::PLAYLIST_ID_ALBUM_PREFIX) {
|
||||
self._navigation_resolve_url(
|
||||
&format!("/playlist?list={}", id),
|
||||
&format!("/playlist?list={id}"),
|
||||
ClientType::DesktopMusic,
|
||||
)
|
||||
.await
|
||||
|
|
@ -225,7 +225,7 @@ impl RustyPipeQuery {
|
|||
}
|
||||
// URL without protocol
|
||||
else if string.contains('/') && string.contains('.') {
|
||||
self.resolve_url(&format!("https://{}", string), resolve_albums)
|
||||
self.resolve_url(&format!("https://{string}"), resolve_albums)
|
||||
.await
|
||||
}
|
||||
// ID only
|
||||
|
|
@ -241,7 +241,7 @@ impl RustyPipeQuery {
|
|||
} else if util::PLAYLIST_ID_REGEX.is_match(string) {
|
||||
if resolve_albums && string.starts_with(util::PLAYLIST_ID_ALBUM_PREFIX) {
|
||||
self._navigation_resolve_url(
|
||||
&format!("/playlist?list={}", string),
|
||||
&format!("/playlist?list={string}"),
|
||||
ClientType::DesktopMusic,
|
||||
)
|
||||
.await
|
||||
|
|
|
|||
|
|
@ -100,8 +100,7 @@ impl MapResponse<VideoDetails> for response::VideoDetails {
|
|||
let video_id = current_video_endpoint.watch_endpoint.video_id;
|
||||
if id != video_id {
|
||||
return Err(ExtractionError::WrongResult(format!(
|
||||
"got wrong playlist id {}, expected {}",
|
||||
video_id, id
|
||||
"got wrong playlist id {video_id}, expected {id}"
|
||||
)));
|
||||
}
|
||||
|
||||
|
|
@ -555,8 +554,7 @@ mod tests {
|
|||
#[case::new_cont("20221011_new_continuation", "ZeerrnuLi5E")]
|
||||
#[case::no_recommends("20221011_rec_isr", "nFDBxBUfE74")]
|
||||
fn map_video_details(#[case] name: &str, #[case] id: &str) {
|
||||
let json_path =
|
||||
path!("testfiles" / "video_details" / format!("video_details_{}.json", name));
|
||||
let json_path = path!("testfiles" / "video_details" / format!("video_details_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let details: response::VideoDetails =
|
||||
|
|
@ -568,7 +566,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_video_details_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_video_details_{name}"), map_res.c, {
|
||||
".publish_date" => "[date]",
|
||||
".recommended.items[].publish_date" => "[date]",
|
||||
});
|
||||
|
|
@ -592,7 +590,7 @@ mod tests {
|
|||
#[case::top("top")]
|
||||
#[case::latest("latest")]
|
||||
fn map_comments(#[case] name: &str) {
|
||||
let json_path = path!("testfiles" / "video_details" / format!("comments_{}.json", name));
|
||||
let json_path = path!("testfiles" / "video_details" / format!("comments_{name}.json"));
|
||||
let json_file = File::open(json_path).unwrap();
|
||||
|
||||
let comments: response::VideoComments =
|
||||
|
|
@ -604,7 +602,7 @@ mod tests {
|
|||
"deserialization/mapping warnings: {:?}",
|
||||
map_res.warnings
|
||||
);
|
||||
insta::assert_ron_snapshot!(format!("map_comments_{}", name), map_res.c, {
|
||||
insta::assert_ron_snapshot!(format!("map_comments_{name}"), map_res.c, {
|
||||
".items[].publish_date" => "[date]",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ fn get_sig_fn_name(player_js: &str) -> Result<String> {
|
|||
}
|
||||
|
||||
fn caller_function(fn_name: &str) -> String {
|
||||
format!("var {}={};", DEOBFUSCATION_FUNC_NAME, fn_name)
|
||||
format!("var {DEOBFUSCATION_FUNC_NAME}={fn_name};")
|
||||
}
|
||||
|
||||
fn get_sig_fn(player_js: &str) -> Result<String> {
|
||||
|
|
@ -274,8 +274,7 @@ async fn get_player_js_url(http: &Client) -> Result<String> {
|
|||
.as_str();
|
||||
|
||||
Ok(format!(
|
||||
"https://www.youtube.com/s/player/{}/player_ias.vflset/en_US/base.js",
|
||||
player_hash
|
||||
"https://www.youtube.com/s/player/{player_hash}/player_ias.vflset/en_US/base.js"
|
||||
))
|
||||
}
|
||||
|
||||
|
|
@ -402,8 +401,8 @@ c[36](c[8],c[32]),c[20](c[25],c[10]),c[2](c[22],c[8]),c[32](c[20],c[16]),c[32](c
|
|||
let deobf = tokio_test::block_on(Deobfuscator::new(client)).unwrap();
|
||||
|
||||
let deobf_sig = deobf.deobfuscate_sig("GOqGOqGOq0QJ8wRAIgaryQHfplJ9xJSKFywyaSMHuuwZYsoMTAvRvfm51qIGECIA5061zWeyfMPX9hEl_U6f9J0tr7GTJMKyPf5XNrJb5fb5i").unwrap();
|
||||
println!("{}", deobf_sig);
|
||||
println!("{deobf_sig}");
|
||||
let deobf_nsig = deobf.deobfuscate_nsig("WHbZ-Nj2TSJxder").unwrap();
|
||||
println!("{}", deobf_nsig);
|
||||
println!("{deobf_nsig}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,17 +93,17 @@ impl UrlTarget {
|
|||
pub fn to_url_yt_host(&self, yt_host: &str) -> String {
|
||||
match self {
|
||||
UrlTarget::Video { id, start_time, .. } => match start_time {
|
||||
0 => format!("{}/watch?v={}", yt_host, id),
|
||||
n => format!("{}/watch?v={}&t={}s", yt_host, id, n),
|
||||
0 => format!("{yt_host}/watch?v={id}"),
|
||||
n => format!("{yt_host}/watch?v={id}&t={n}s"),
|
||||
},
|
||||
UrlTarget::Channel { id } => {
|
||||
format!("{}/channel/{}", yt_host, id)
|
||||
format!("{yt_host}/channel/{id}")
|
||||
}
|
||||
UrlTarget::Playlist { id } => {
|
||||
format!("{}/playlist?list={}", yt_host, id)
|
||||
format!("{yt_host}/playlist?list={id}")
|
||||
}
|
||||
UrlTarget::Album { id } => {
|
||||
format!("https://music.youtube.com/browse/{}", id)
|
||||
format!("https://music.youtube.com/browse/{id}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -848,13 +848,13 @@ impl Display for Country {
|
|||
impl FromStr for Language {
|
||||
type Err = serde_json::Error;
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
serde_json::from_str(&format!("\"{}\"", s))
|
||||
serde_json::from_str(&format!("\"{s}\""))
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Country {
|
||||
type Err = serde_json::Error;
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
serde_json::from_str(&format!("\"{}\"", s))
|
||||
serde_json::from_str(&format!("\"{s}\""))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ impl FileReporter {
|
|||
fn _report(&self, report: &Report) -> Result<(), Error> {
|
||||
let report_path = get_report_path(&self.path, report, "json")?;
|
||||
serde_json::to_writer_pretty(&File::create(report_path)?, &report)
|
||||
.map_err(|e| Error::Other(format!("could not serialize report. err: {}", e).into()))?;
|
||||
.map_err(|e| Error::Other(format!("could not serialize report. err: {e}").into()))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
@ -162,13 +162,13 @@ fn get_report_path(root: &Path, report: &Report, ext: &str) -> Result<PathBuf, E
|
|||
);
|
||||
|
||||
let mut report_path = root.to_path_buf();
|
||||
report_path.push(format!("{}.{}", filename_prefix, ext));
|
||||
report_path.push(format!("{filename_prefix}.{ext}"));
|
||||
|
||||
// ensure unique filename
|
||||
for i in 1..u32::MAX {
|
||||
if report_path.exists() {
|
||||
report_path = root.to_path_buf();
|
||||
report_path.push(format!("{}_{}.{}", filename_prefix, i, ext));
|
||||
report_path.push(format!("{filename_prefix}_{i}.{ext}"));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ pub(crate) fn parse_timeago_or_warn(
|
|||
) -> Option<TimeAgo> {
|
||||
let res = parse_timeago(lang, textual_date);
|
||||
if res.is_none() {
|
||||
warnings.push(format!("could not parse timeago `{}`", textual_date));
|
||||
warnings.push(format!("could not parse timeago `{textual_date}`"));
|
||||
}
|
||||
res
|
||||
}
|
||||
|
|
@ -221,7 +221,7 @@ pub(crate) fn parse_timeago_dt_or_warn(
|
|||
) -> Option<OffsetDateTime> {
|
||||
let res = parse_timeago_to_dt(lang, textual_date);
|
||||
if res.is_none() {
|
||||
warnings.push(format!("could not parse timeago `{}`", textual_date));
|
||||
warnings.push(format!("could not parse timeago `{textual_date}`"));
|
||||
}
|
||||
res
|
||||
}
|
||||
|
|
@ -288,7 +288,7 @@ pub(crate) fn parse_textual_date_or_warn(
|
|||
) -> Option<OffsetDateTime> {
|
||||
let res = parse_textual_date_to_dt(lang, textual_date);
|
||||
if res.is_none() {
|
||||
warnings.push(format!("could not parse textual date `{}`", textual_date));
|
||||
warnings.push(format!("could not parse textual date `{textual_date}`"));
|
||||
}
|
||||
res
|
||||
}
|
||||
|
|
@ -482,9 +482,7 @@ mod tests {
|
|||
assert_eq!(
|
||||
parse_timeago(*lang, s),
|
||||
Some(expect[n]),
|
||||
"Language: {}, n: {}",
|
||||
lang,
|
||||
n
|
||||
"Language: {lang}, n: {n}"
|
||||
);
|
||||
});
|
||||
})
|
||||
|
|
@ -515,9 +513,7 @@ mod tests {
|
|||
assert_eq!(
|
||||
timeago,
|
||||
Some(TimeAgo { n: *n, unit: *t }),
|
||||
"lang: {}, txt: {}",
|
||||
lang,
|
||||
txt
|
||||
"lang: {lang}, txt: {txt}"
|
||||
);
|
||||
|
||||
n_cases += 1;
|
||||
|
|
@ -561,8 +557,7 @@ mod tests {
|
|||
n: 0,
|
||||
unit: TimeUnit::Day
|
||||
})),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Yesterday").unwrap()),
|
||||
|
|
@ -574,8 +569,7 @@ mod tests {
|
|||
},
|
||||
unit: TimeUnit::Day
|
||||
})),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Ago").unwrap()),
|
||||
|
|
@ -583,80 +577,67 @@ mod tests {
|
|||
n: 3,
|
||||
unit: TimeUnit::Day
|
||||
})),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Jan").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2020 - 1 - 3))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Feb").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2016 - 2 - 7))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Mar").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2015 - 3 - 9))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Apr").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2017 - 4 - 2))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("May").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2014 - 5 - 22))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Jun").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2014 - 6 - 28))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Jul").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2014 - 7 - 2))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Aug").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2015 - 8 - 23))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Sep").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2018 - 9 - 16))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Oct").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2014 - 10 - 31))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Nov").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2016 - 11 - 3))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
assert_eq!(
|
||||
parse_textual_date(*lang, samples.get("Dec").unwrap()),
|
||||
Some(ParsedDate::Absolute(date!(2021 - 12 - 24))),
|
||||
"lang: {}",
|
||||
lang
|
||||
"lang: {lang}"
|
||||
);
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ pub fn generate_content_playback_nonce() -> String {
|
|||
/// `example.com/api?k1=v1&k2=v2 => example.com/api; {k1: v1, k2: v2}`
|
||||
pub fn url_to_params(url: &str) -> Result<(Url, BTreeMap<String, String>), Error> {
|
||||
let mut parsed_url = Url::parse(url)
|
||||
.map_err(|e| Error::Other(format!("could not parse url `{}` err: {}", url, e).into()))?;
|
||||
.map_err(|e| Error::Other(format!("could not parse url `{url}` err: {e}").into()))?;
|
||||
let url_params: BTreeMap<String, String> = parsed_url
|
||||
.query_pairs()
|
||||
.map(|(k, v)| (k.to_string(), v.to_string()))
|
||||
|
|
@ -168,7 +168,7 @@ where
|
|||
{
|
||||
let res = parse_numeric::<F>(string);
|
||||
if res.is_err() {
|
||||
warnings.push(format!("could not parse number `{}`", string));
|
||||
warnings.push(format!("could not parse number `{string}`"));
|
||||
}
|
||||
res.ok()
|
||||
}
|
||||
|
|
@ -409,10 +409,7 @@ mod tests {
|
|||
let res = retry_delay(n, 1000, 60000, 3);
|
||||
assert!(
|
||||
res >= expect_min && res <= expect_max,
|
||||
"res: {} not within {} and {}",
|
||||
res,
|
||||
expect_min,
|
||||
expect_max
|
||||
"res: {res} not within {expect_min} and {expect_max}"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -490,10 +487,6 @@ mod tests {
|
|||
};
|
||||
|
||||
let res = parse_large_numstr::<u64>(string, lang).expect(string);
|
||||
assert_eq!(
|
||||
res, rounded,
|
||||
"{} (lang: {}, exact: {})",
|
||||
string, lang, expect
|
||||
);
|
||||
assert_eq!(res, rounded, "{string} (lang: {lang}, exact: {expect})");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue