Skip to content

Commit 9d303a2

Browse files
committed
Fix errors from update to rust 1.65
1 parent 77b821a commit 9d303a2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stdlib/src/ssl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,13 @@ mod _ssl {
295295
}
296296

297297
fn _txt2obj(s: &CStr, no_name: bool) -> Option<Asn1Object> {
298-
unsafe { ptr2obj(sys::OBJ_txt2obj(s.as_ptr(), if no_name { 1 } else { 0 })) }
298+
unsafe { ptr2obj(sys::OBJ_txt2obj(s.as_ptr(), i32::from(no_name))) }
299299
}
300300
fn _nid2obj(nid: Nid) -> Option<Asn1Object> {
301301
unsafe { ptr2obj(sys::OBJ_nid2obj(nid.as_raw())) }
302302
}
303303
fn obj2txt(obj: &Asn1ObjectRef, no_name: bool) -> Option<String> {
304-
let no_name = if no_name { 1 } else { 0 };
304+
let no_name = i32::from(no_name);
305305
let ptr = obj.as_ptr();
306306
let b = unsafe {
307307
let buflen = sys::OBJ_obj2txt(std::ptr::null_mut(), 0, ptr, no_name);

vm/src/stdlib/winreg.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ mod winreg {
191191
key.with_key(|k| k.get_raw_value(subkey))
192192
.map_err(|e| e.to_pyexception(vm))
193193
.and_then(|regval| {
194-
let ty = regval.vtype as usize;
194+
#[allow(clippy::redundant_clone)]
195+
let ty = regval.vtype.clone() as usize;
195196
Ok((reg_to_py(regval, vm)?, ty))
196197
})
197198
}
@@ -221,7 +222,8 @@ mod winreg {
221222
})
222223
.map_err(|e| e.to_pyexception(vm))
223224
.and_then(|(name, value)| {
224-
let ty = value.vtype as usize;
225+
#[allow(clippy::redundant_clone)]
226+
let ty = value.vtype.clone() as usize;
225227
Ok((name, reg_to_py(value, vm)?, ty))
226228
})
227229
}

0 commit comments

Comments
 (0)