1- use std:: { ffi :: OsStr , iter} ;
1+ use std:: iter;
22
33use expect_test:: { expect, Expect } ;
44use hir:: Semantics ;
@@ -18,10 +18,10 @@ use crate::{
1818
1919fn check_external_docs (
2020 ra_fixture : & str ,
21- target_dir : Option < & OsStr > ,
21+ target_dir : Option < & str > ,
2222 expect_web_url : Option < Expect > ,
2323 expect_local_url : Option < Expect > ,
24- sysroot : Option < & OsStr > ,
24+ sysroot : Option < & str > ,
2525) {
2626 let ( analysis, position) = fixture:: position ( ra_fixture) ;
2727 let links = analysis. external_docs ( position, target_dir, sysroot) . unwrap ( ) ;
@@ -127,10 +127,10 @@ fn external_docs_doc_builtin_type() {
127127//- /main.rs crate:foo
128128let x: u3$02 = 0;
129129"# ,
130- Some ( OsStr :: new ( "/home/user/project" ) ) ,
130+ Some ( "/home/user/project" ) ,
131131 Some ( expect ! [ [ r#"https://doc.rust-lang.org/nightly/core/primitive.u32.html"# ] ] ) ,
132132 Some ( expect ! [ [ r#"file:///sysroot/share/doc/rust/html/core/primitive.u32.html"# ] ] ) ,
133- Some ( OsStr :: new ( "/sysroot" ) ) ,
133+ Some ( "/sysroot" ) ,
134134 ) ;
135135}
136136
@@ -143,10 +143,10 @@ use foo$0::Foo;
143143//- /lib.rs crate:foo
144144pub struct Foo;
145145"# ,
146- Some ( OsStr :: new ( "/home/user/project" ) ) ,
146+ Some ( "/home/user/project" ) ,
147147 Some ( expect ! [ [ r#"https://docs.rs/foo/*/foo/index.html"# ] ] ) ,
148148 Some ( expect ! [ [ r#"file:///home/user/project/doc/foo/index.html"# ] ] ) ,
149- Some ( OsStr :: new ( "/sysroot" ) ) ,
149+ Some ( "/sysroot" ) ,
150150 ) ;
151151}
152152
@@ -157,10 +157,10 @@ fn external_docs_doc_url_std_crate() {
157157//- /main.rs crate:std
158158use self$0;
159159"# ,
160- Some ( OsStr :: new ( "/home/user/project" ) ) ,
160+ Some ( "/home/user/project" ) ,
161161 Some ( expect ! [ "https://doc.rust-lang.org/stable/std/index.html" ] ) ,
162162 Some ( expect ! [ "file:///sysroot/share/doc/rust/html/std/index.html" ] ) ,
163- Some ( OsStr :: new ( "/sysroot" ) ) ,
163+ Some ( "/sysroot" ) ,
164164 ) ;
165165}
166166
@@ -171,10 +171,10 @@ fn external_docs_doc_url_struct() {
171171//- /main.rs crate:foo
172172pub struct Fo$0o;
173173"# ,
174- Some ( OsStr :: new ( "/home/user/project" ) ) ,
174+ Some ( "/home/user/project" ) ,
175175 Some ( expect ! [ [ r#"https://docs.rs/foo/*/foo/struct.Foo.html"# ] ] ) ,
176176 Some ( expect ! [ [ r#"file:///home/user/project/doc/foo/struct.Foo.html"# ] ] ) ,
177- Some ( OsStr :: new ( "/sysroot" ) ) ,
177+ Some ( "/sysroot" ) ,
178178 ) ;
179179}
180180
@@ -185,10 +185,10 @@ fn external_docs_doc_url_windows_backslash_path() {
185185//- /main.rs crate:foo
186186pub struct Fo$0o;
187187"# ,
188- Some ( OsStr :: new ( r"C:\Users\user\project" ) ) ,
188+ Some ( r"C:\Users\user\project" ) ,
189189 Some ( expect ! [ [ r#"https://docs.rs/foo/*/foo/struct.Foo.html"# ] ] ) ,
190190 Some ( expect ! [ [ r#"file:///C:/Users/user/project/doc/foo/struct.Foo.html"# ] ] ) ,
191- Some ( OsStr :: new ( "/sysroot" ) ) ,
191+ Some ( "/sysroot" ) ,
192192 ) ;
193193}
194194
@@ -199,10 +199,10 @@ fn external_docs_doc_url_windows_slash_path() {
199199//- /main.rs crate:foo
200200pub struct Fo$0o;
201201"# ,
202- Some ( OsStr :: new ( r "C:/Users/user/project") ) ,
202+ Some ( "C:/Users/user/project" ) ,
203203 Some ( expect ! [ [ r#"https://docs.rs/foo/*/foo/struct.Foo.html"# ] ] ) ,
204204 Some ( expect ! [ [ r#"file:///C:/Users/user/project/doc/foo/struct.Foo.html"# ] ] ) ,
205- Some ( OsStr :: new ( "/sysroot" ) ) ,
205+ Some ( "/sysroot" ) ,
206206 ) ;
207207}
208208
0 commit comments