mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Use split1 when formatting function signature params
This commit is contained in:
parent
1211a46826
commit
f06b2bcd91
5 changed files with 12 additions and 11 deletions
|
@ -15,6 +15,7 @@ use std::{
|
|||
};
|
||||
|
||||
pub use ra_cfg::CfgOptions;
|
||||
use stdx::split1;
|
||||
|
||||
pub use relative_path::{RelativePath, RelativePathBuf};
|
||||
pub use rustc_hash::FxHashMap;
|
||||
|
@ -332,11 +333,6 @@ fn parse_meta(meta: &str) -> FixtureMeta {
|
|||
FixtureMeta::File(FileMeta { path, crate_name: krate, deps, edition, cfg, env })
|
||||
}
|
||||
|
||||
fn split1(haystack: &str, delim: char) -> Option<(&str, &str)> {
|
||||
let idx = haystack.find(delim)?;
|
||||
Some((&haystack[..idx], &haystack[idx + delim.len_utf8()..]))
|
||||
}
|
||||
|
||||
/// Adjusts the indentation of the first line to the minimum indentation of the rest of the lines.
|
||||
/// This allows fixtures to start off in a different indentation, e.g. to align the first line with
|
||||
/// the other lines visually:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue