Skip to content

Fix when MSRV>=1.93 #3193

@larseggert

Description

@larseggert

We need rust 1.93...

        while self.used > target { // note renamed from reduce
            let Some(e) = self.dynamic.pop_back_if(|e| e.can_reduce(self.acked_inserts_cnt)) else {
                return false;
            };
            self.used -= u64::try_from(e.size()).expect("usize fits in u64");
        }

As it is, I think that what you have is fine. It's just not as idiomatic as you might like.

Originally posted by @martinthomson in #3181 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions