Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/doc_links/tests.rs')
-rw-r--r--crates/ide/src/doc_links/tests.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/crates/ide/src/doc_links/tests.rs b/crates/ide/src/doc_links/tests.rs
index 60e8d29a71..ac44908a90 100644
--- a/crates/ide/src/doc_links/tests.rs
+++ b/crates/ide/src/doc_links/tests.rs
@@ -1,4 +1,4 @@
-use std::{ffi::OsStr, iter};
+use std::iter;
use expect_test::{expect, Expect};
use hir::Semantics;
@@ -18,10 +18,10 @@ use crate::{
fn check_external_docs(
ra_fixture: &str,
- target_dir: Option<&OsStr>,
+ target_dir: Option<&str>,
expect_web_url: Option<Expect>,
expect_local_url: Option<Expect>,
- sysroot: Option<&OsStr>,
+ sysroot: Option<&str>,
) {
let (analysis, position) = fixture::position(ra_fixture);
let links = analysis.external_docs(position, target_dir, sysroot).unwrap();
@@ -127,10 +127,10 @@ fn external_docs_doc_builtin_type() {
//- /main.rs crate:foo
let x: u3$02 = 0;
"#,
- Some(OsStr::new("/home/user/project")),
+ Some("/home/user/project"),
Some(expect![[r#"https://doc.rust-lang.org/nightly/core/primitive.u32.html"#]]),
Some(expect![[r#"file:///sysroot/share/doc/rust/html/core/primitive.u32.html"#]]),
- Some(OsStr::new("/sysroot")),
+ Some("/sysroot"),
);
}
@@ -143,10 +143,10 @@ use foo$0::Foo;
//- /lib.rs crate:foo
pub struct Foo;
"#,
- Some(OsStr::new("/home/user/project")),
+ Some("/home/user/project"),
Some(expect![[r#"https://docs.rs/foo/*/foo/index.html"#]]),
Some(expect![[r#"file:///home/user/project/doc/foo/index.html"#]]),
- Some(OsStr::new("/sysroot")),
+ Some("/sysroot"),
);
}
@@ -157,10 +157,10 @@ fn external_docs_doc_url_std_crate() {
//- /main.rs crate:std
use self$0;
"#,
- Some(OsStr::new("/home/user/project")),
+ Some("/home/user/project"),
Some(expect!["https://doc.rust-lang.org/stable/std/index.html"]),
Some(expect!["file:///sysroot/share/doc/rust/html/std/index.html"]),
- Some(OsStr::new("/sysroot")),
+ Some("/sysroot"),
);
}
@@ -171,10 +171,10 @@ fn external_docs_doc_url_struct() {
//- /main.rs crate:foo
pub struct Fo$0o;
"#,
- Some(OsStr::new("/home/user/project")),
+ Some("/home/user/project"),
Some(expect![[r#"https://docs.rs/foo/*/foo/struct.Foo.html"#]]),
Some(expect![[r#"file:///home/user/project/doc/foo/struct.Foo.html"#]]),
- Some(OsStr::new("/sysroot")),
+ Some("/sysroot"),
);
}
@@ -185,10 +185,10 @@ fn external_docs_doc_url_windows_backslash_path() {
//- /main.rs crate:foo
pub struct Fo$0o;
"#,
- Some(OsStr::new(r"C:\Users\user\project")),
+ Some(r"C:\Users\user\project"),
Some(expect![[r#"https://docs.rs/foo/*/foo/struct.Foo.html"#]]),
Some(expect![[r#"file:///C:/Users/user/project/doc/foo/struct.Foo.html"#]]),
- Some(OsStr::new("/sysroot")),
+ Some("/sysroot"),
);
}
@@ -199,10 +199,10 @@ fn external_docs_doc_url_windows_slash_path() {
//- /main.rs crate:foo
pub struct Fo$0o;
"#,
- Some(OsStr::new(r"C:/Users/user/project")),
+ Some("C:/Users/user/project"),
Some(expect![[r#"https://docs.rs/foo/*/foo/struct.Foo.html"#]]),
Some(expect![[r#"file:///C:/Users/user/project/doc/foo/struct.Foo.html"#]]),
- Some(OsStr::new("/sysroot")),
+ Some("/sysroot"),
);
}