aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_db/src/input.rs')
-rw-r--r--crates/ra_db/src/input.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs
index a6a831afa..bde843001 100644
--- a/crates/ra_db/src/input.rs
+++ b/crates/ra_db/src/input.rs
@@ -14,6 +14,7 @@ use rustc_hash::FxHashMap;
14use rustc_hash::FxHashSet; 14use rustc_hash::FxHashSet;
15 15
16use crate::{RelativePath, RelativePathBuf}; 16use crate::{RelativePath, RelativePathBuf};
17use fmt::Display;
17 18
18/// `FileId` is an integer which uniquely identifies a file. File paths are 19/// `FileId` is an integer which uniquely identifies a file. File paths are
19/// messy and system-dependent, so most of the code should work directly with 20/// messy and system-dependent, so most of the code should work directly with
@@ -102,9 +103,11 @@ impl CrateName {
102 pub fn normalize_dashes(name: &str) -> CrateName { 103 pub fn normalize_dashes(name: &str) -> CrateName {
103 Self(SmolStr::new(name.replace('-', "_"))) 104 Self(SmolStr::new(name.replace('-', "_")))
104 } 105 }
106}
105 107
106 pub fn get_name(&self) -> String { 108impl Display for CrateName {
107 self.0.to_string() 109 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
110 write!(f, "{}", self.0)
108 } 111 }
109} 112}
110 113