From 6a6098d4c31f6b54c8768e32f24182645ac077d6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 22 Jun 2020 17:30:23 +0200 Subject: Remove RelativePathBuf from fixture The paths in fixture are not really relative (the default one is `/main.rs`), so it doesn't make sense to use `RelativePathBuf` here. --- crates/test_utils/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/test_utils') diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index 981565cd7..b1333cf15 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -168,13 +168,13 @@ pub struct FixtureEntry { #[derive(Debug, Eq, PartialEq)] pub enum FixtureMeta { - Root { path: RelativePathBuf }, + Root { path: String }, File(FileMeta), } #[derive(Debug, Eq, PartialEq)] pub struct FileMeta { - pub path: RelativePathBuf, + pub path: String, pub crate_name: Option, pub deps: Vec, pub cfg: CfgOptions, @@ -183,7 +183,7 @@ pub struct FileMeta { } impl FixtureMeta { - pub fn path(&self) -> &RelativePath { + pub fn path(&self) -> &str { match self { FixtureMeta::Root { path } => &path, FixtureMeta::File(f) => &f.path, @@ -292,12 +292,12 @@ fn parse_meta(meta: &str) -> FixtureMeta { let components = meta.split_ascii_whitespace().collect::>(); if components[0] == "root" { - let path: RelativePathBuf = components[1].into(); + let path = components[1].to_string(); assert!(path.starts_with("/") && path.ends_with("/")); return FixtureMeta::Root { path }; } - let path: RelativePathBuf = components[0].into(); + let path = components[0].to_string(); assert!(path.starts_with("/")); let mut krate = None; -- cgit v1.2.3