File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed
src/tools/clippy/clippy_utils/src Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1380,7 +1380,7 @@ pub enum ExternalSourceKind {
13801380}
13811381
13821382impl ExternalSource {
1383- pub fn get_source ( & self ) -> Option < & Lrc < String > > {
1383+ pub fn get_source ( & self ) -> Option < & str > {
13841384 match self {
13851385 ExternalSource :: Foreign { kind : ExternalSourceKind :: Present ( ref src) , .. } => Some ( src) ,
13861386 _ => None ,
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ fn t10() {
257257 ) ;
258258 imported_src_file. add_external_src ( || Some ( unnormalized. to_string ( ) ) ) ;
259259 assert_eq ! (
260- imported_src_file. external_src. borrow( ) . get_source( ) . unwrap( ) . as_ref ( ) ,
260+ imported_src_file. external_src. borrow( ) . get_source( ) . unwrap( ) ,
261261 normalized,
262262 "imported source file should be normalized"
263263 ) ;
Original file line number Diff line number Diff line change @@ -287,6 +287,7 @@ impl SourceFileRange {
287287 self . sf
288288 . src
289289 . as_ref ( )
290+ . map ( |src| src. as_str ( ) )
290291 . or_else ( || self . sf . external_src . get ( ) . and_then ( |src| src. get_source ( ) ) )
291292 . and_then ( |x| x. get ( self . range . clone ( ) ) )
292293 }
You can’t perform that action at this time.
0 commit comments