fix: wrong debug_assert in OrderedFloat for NaN (#1547)

This commit is contained in:
Zhang ShengYan 2024-08-24 09:41:25 +08:00 committed by sxyazi
parent c9d74360bf
commit 69c20d4dd3
No known key found for this signature in database
3 changed files with 5 additions and 3 deletions

View file

@ -6,6 +6,8 @@ use clap::Parser;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
yazi_shared::init();
if std::env::args_os().nth(1).is_some_and(|s| s == "-V" || s == "--version") {
println!(
"Ya {} ({} {})",

View file

@ -182,13 +182,13 @@ delete_offset = [ 0, 0, 70, 20 ]
overwrite_title = "Overwrite file?"
overwrite_content = "Will overwrite the following file:"
overwrite_origin = "center"
overwrite_offset = [ 0, 0, 50, 20 ]
overwrite_offset = [ 0, 0, 50, 15 ]
# quit
quit_title = "Quit?"
quit_content = "The following task is still running, are you sure you want to quit?"
quit_origin = "center"
quit_offset = [ 0, 0, 50, 20 ]
quit_offset = [ 0, 0, 50, 15 ]
[select]
open_title = "Open with:"

View file

@ -9,7 +9,7 @@ pub struct OrderedFloat(f64);
impl OrderedFloat {
#[inline]
pub fn new(t: f64) -> Self {
debug_assert!(t.is_nan());
debug_assert!(!t.is_nan());
Self(t)
}