mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Stabilize str_split_once
This commit is contained in:
parent
097bc6a84f
commit
c28f2a8bee
@ -5,8 +5,7 @@
|
||||
associated_type_bounds,
|
||||
never_type,
|
||||
try_blocks,
|
||||
hash_drain_filter,
|
||||
str_split_once
|
||||
hash_drain_filter
|
||||
)]
|
||||
#![warn(rust_2018_idioms)]
|
||||
#![warn(unused_lifetimes)]
|
||||
|
@ -28,7 +28,6 @@ Rust MIR: a lowered representation of Rust.
|
||||
#![feature(or_patterns)]
|
||||
#![feature(once_cell)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![feature(str_split_once)]
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
#[macro_use]
|
||||
|
@ -1,7 +1,6 @@
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(once_cell)]
|
||||
#![feature(or_patterns)]
|
||||
#![feature(str_split_once)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
@ -22,7 +22,6 @@
|
||||
#![feature(nll)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(option_expect_none)]
|
||||
#![feature(str_split_once)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
@ -15,7 +15,6 @@
|
||||
#![feature(never_type)]
|
||||
#![feature(associated_type_bounds)]
|
||||
#![feature(exhaustive_patterns)]
|
||||
#![feature(str_split_once)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
@ -6,7 +6,6 @@
|
||||
#![feature(exact_size_is_empty)]
|
||||
#![feature(new_uninit)]
|
||||
#![feature(pattern)]
|
||||
#![feature(str_split_once)]
|
||||
#![feature(trusted_len)]
|
||||
#![feature(try_reserve)]
|
||||
#![feature(unboxed_closures)]
|
||||
|
@ -1506,13 +1506,11 @@ impl str {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(str_split_once)]
|
||||
///
|
||||
/// assert_eq!("cfg".split_once('='), None);
|
||||
/// assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
|
||||
/// assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
|
||||
/// ```
|
||||
#[unstable(feature = "str_split_once", reason = "newly added", issue = "74773")]
|
||||
#[stable(feature = "str_split_once", since = "1.52.0")]
|
||||
#[inline]
|
||||
pub fn split_once<'a, P: Pattern<'a>>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)> {
|
||||
let (start, end) = delimiter.into_searcher(self).next_match()?;
|
||||
@ -1525,13 +1523,11 @@ impl str {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(str_split_once)]
|
||||
///
|
||||
/// assert_eq!("cfg".rsplit_once('='), None);
|
||||
/// assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
|
||||
/// assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
|
||||
/// ```
|
||||
#[unstable(feature = "str_split_once", reason = "newly added", issue = "74773")]
|
||||
#[stable(feature = "str_split_once", since = "1.52.0")]
|
||||
#[inline]
|
||||
pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
|
||||
where
|
||||
|
@ -314,7 +314,6 @@
|
||||
#![feature(stdsimd)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![feature(str_internals)]
|
||||
#![feature(str_split_once)]
|
||||
#![feature(test)]
|
||||
#![feature(thread_local)]
|
||||
#![feature(thread_local_internals)]
|
||||
|
@ -31,7 +31,6 @@
|
||||
#![feature(termination_trait_lib)]
|
||||
#![feature(test)]
|
||||
#![feature(total_cmp)]
|
||||
#![feature(str_split_once)]
|
||||
|
||||
// Public reexports
|
||||
pub use self::bench::{black_box, Bencher};
|
||||
|
@ -14,7 +14,6 @@
|
||||
#![feature(never_type)]
|
||||
#![feature(once_cell)]
|
||||
#![feature(type_ascription)]
|
||||
#![feature(str_split_once)]
|
||||
#![feature(iter_intersperse)]
|
||||
#![recursion_limit = "256"]
|
||||
#![deny(rustc::internal)]
|
||||
|
@ -14,7 +14,7 @@
|
||||
//! A few exceptions are allowed as there's known bugs in rustdoc, but this
|
||||
//! should catch the majority of "broken link" cases.
|
||||
|
||||
#![feature(str_split_once)]
|
||||
#![cfg_attr(bootstrap, feature(str_split_once))]
|
||||
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
@ -3,7 +3,7 @@
|
||||
//! This library contains the tidy lints and exposes it
|
||||
//! to be used by tools.
|
||||
|
||||
#![feature(str_split_once)]
|
||||
#![cfg_attr(bootstrap, feature(str_split_once))]
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
Loading…
Reference in New Issue
Block a user