File tree 3 files changed +3
-2
lines changed
src/tools/clippy/clippy_utils/src
3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1380,7 +1380,7 @@ pub enum ExternalSourceKind {
1380
1380
}
1381
1381
1382
1382
impl ExternalSource {
1383
- pub fn get_source ( & self ) -> Option < & Lrc < String > > {
1383
+ pub fn get_source ( & self ) -> Option < & str > {
1384
1384
match self {
1385
1385
ExternalSource :: Foreign { kind : ExternalSourceKind :: Present ( ref src) , .. } => Some ( src) ,
1386
1386
_ => None ,
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ fn t10() {
257
257
) ;
258
258
imported_src_file. add_external_src ( || Some ( unnormalized. to_string ( ) ) ) ;
259
259
assert_eq ! (
260
- imported_src_file. external_src. borrow( ) . get_source( ) . unwrap( ) . as_ref ( ) ,
260
+ imported_src_file. external_src. borrow( ) . get_source( ) . unwrap( ) ,
261
261
normalized,
262
262
"imported source file should be normalized"
263
263
) ;
Original file line number Diff line number Diff line change @@ -287,6 +287,7 @@ impl SourceFileRange {
287
287
self . sf
288
288
. src
289
289
. as_ref ( )
290
+ . map ( |src| src. as_str ( ) )
290
291
. or_else ( || self . sf . external_src . get ( ) . and_then ( |src| src. get_source ( ) ) )
291
292
. and_then ( |x| x. get ( self . range . clone ( ) ) )
292
293
}
You can’t perform that action at this time.
0 commit comments