Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • rust
  • alloc
  • vec
  • mod.rs
Find file BlameHistoryPermalink
  • Miguel Ojeda's avatar
    rust: alloc: add `Vec::try_with_capacity{,_in}()` constructors · feadd062
    Miguel Ojeda authored Nov 10, 2022
    
    
    Add `Vec::try_with_capacity()` and `Vec::try_with_capacity_in()` as
    the fallible versions of `Vec::with_capacity()` and
    `Vec::with_capacity_in()`, respectively.
    
    The implementations follow the originals and use the previously
    added `RawVec::try_with_capacity_in()`.
    
    In turn, `Vec::try_with_capacity()` will be used to implement
    the `CString` type (which wraps a `Vec<u8>`) in a later patch.
    
    Reviewed-by: default avatarGary Guo <gary@garyguo.net>
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    feadd062
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7