// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.
// TODO(firsching): as soon as "Vec::try_with_capacity" is available from the // standard library use this instead of the functions here. pubtrait NewWithCapacity { type Output; type Error; fn new_with_capacity(capacity: usize) -> Result<Self::Output, Self::Error>;
}
impl<T> NewWithCapacity for Vec<T> { type Output = Vec<T>; type Error = std::collections::TryReserveError;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.