Skip to content

Commit 4be202f

Browse files
committed
dont use as_ref
1 parent 4e74df9 commit 4be202f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/ide/src/runnables.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ pub enum TestId {
4343
Path(String),
4444
}
4545

46-
impl AsRef<str> for TestId {
47-
fn as_ref(&self) -> &str {
46+
impl TestId {
47+
pub fn as_str(&self) -> &str {
4848
match self {
4949
Self::Name(n) => n,
5050
Self::Path(p) => p,
@@ -54,7 +54,7 @@ impl AsRef<str> for TestId {
5454

5555
impl fmt::Display for TestId {
5656
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
57-
f.write_str(self.as_ref())
57+
f.write_str(self.as_str())
5858
}
5959
}
6060

crates/rust-analyzer/src/target_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl ProjectJsonTargetSpec {
9191
runnable.args.iter_mut().for_each(|arg| {
9292
*arg = arg
9393
.replace("{label}", &self.label)
94-
.replace("{test_id}", test_id.as_ref());
94+
.replace("{test_id}", test_id.as_str());
9595
});
9696

9797
runnable

0 commit comments

Comments
 (0)