Implement Ranged on more structs (#6639)

## Summary

I noticed some inconsistencies around uses of `.range.start()`, structs
that have a `TextRange` field but don't implement `Ranged`, etc.

## Test Plan

`cargo test`
This commit is contained in:
Charlie Marsh 2023-08-17 11:22:39 -04:00 committed by GitHub
parent a70807e1e1
commit db1c556508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 221 additions and 176 deletions

View file

@ -87,10 +87,8 @@ impl Strategy for StrategyRemoveModuleMember {
) -> Result<Box<dyn ExactSizeStringIter + 'a>> {
let iter = ast.iter().map(|stmt| {
// trim the newlines the range misses
input[..stmt.range().start().to_usize()]
.trim_end()
.to_string()
+ input[stmt.range().end().to_usize()..].trim_start()
input[..stmt.start().to_usize()].trim_end().to_string()
+ input[stmt.end().to_usize()..].trim_start()
});
Ok(Box::new(iter))
}