diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-10 09:06:01 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-10 09:06:01 +0000 |
commit | b4ac3dda78ebea1b483c0164a39907daa0c8caaa (patch) | |
tree | a4a834a6a9b6f8ab4b0be5a4da77af36f894f588 /crates/ra_hir_def/src | |
parent | abeadb29cea2ecf158bf89eb0da5498dfebbaea9 (diff) | |
parent | 139479e8a376aecff35db2055b9ebd2311935f98 (diff) |
Merge #3075
3075: Migrate u32::from(TextUnit) as usize to .to_usize() r=matklad a=Veetaha
@matklad I see 29 uses of `.to_usize()` cast, wouldn't it be reasonable to change `TextUnit(u32)` to `TextUnit(usize)` ? Or do you have reasons to stick with `u32` here?
Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/body/scope.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index a63552327..5d0279945 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs | |||
@@ -194,7 +194,7 @@ mod tests { | |||
194 | let (off, code) = extract_offset(code); | 194 | let (off, code) = extract_offset(code); |
195 | let code = { | 195 | let code = { |
196 | let mut buf = String::new(); | 196 | let mut buf = String::new(); |
197 | let off = u32::from(off) as usize; | 197 | let off = off.to_usize(); |
198 | buf.push_str(&code[..off]); | 198 | buf.push_str(&code[..off]); |
199 | buf.push_str("marker"); | 199 | buf.push_str("marker"); |
200 | buf.push_str(&code[off..]); | 200 | buf.push_str(&code[off..]); |