File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -859,7 +859,7 @@ impl Client {
859
859
/// # Cautions
860
860
/// * Holds returned watcher without polling events may result in memory burst.
861
861
/// * At the time of written, ZooKeeper [ZOOKEEPER-4466][] does not support oneshot and
862
- /// persistent watch on same path.
862
+ /// persistent watch on same path.
863
863
/// * Persistent watch could lose events during reconnection due to [ZOOKEEPER-4698][].
864
864
///
865
865
/// [ZOOKEEPER-4466]: https://issues.apache.org/jira/browse/ZOOKEEPER-4466
@@ -1137,8 +1137,8 @@ impl Client {
1137
1137
///
1138
1138
/// # Error handling on [Error::ConnectionLoss]
1139
1139
/// * If connection loss during lock path creation, this method will find out the created lock
1140
- /// path if creation success by matching prefix for [LockPrefix::new_curator] or ephemeral
1141
- /// owner for others.
1140
+ /// path if creation success by matching prefix for [LockPrefix::new_curator] or ephemeral
1141
+ /// owner for others.
1142
1142
/// * Retry all other operations on connection loss.
1143
1143
///
1144
1144
/// # Notable issues
@@ -1287,7 +1287,7 @@ impl<'a> LockPrefix<'a> {
1287
1287
///
1288
1288
/// # Notable usages
1289
1289
/// * Uses "{dir}/x-{session_id}-" as `prefix` and "x-" or "" as `name` for ZooKeeper java
1290
- /// client's [WriteLock].
1290
+ /// client's [WriteLock].
1291
1291
///
1292
1292
/// [WriteLock]: https://github.com/apache/zookeeper/blob/release-3.9.0/zookeeper-recipes/zookeeper-recipes-lock/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java#L212
1293
1293
pub fn new_custom ( prefix : String , name : & ' a str ) -> Result < Self > {
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ pub trait AsyncReadToBuf: AsyncReadExt {
40
40
where
41
41
Self : Unpin , {
42
42
let chunk = buf. chunk_mut ( ) ;
43
- let read_to = unsafe { std:: mem:: transmute ( chunk. as_uninit_slice_mut ( ) ) } ;
43
+ let read_to =
44
+ unsafe { std:: mem:: transmute :: < & mut [ std:: mem:: MaybeUninit < u8 > ] , & mut [ u8 ] > ( chunk. as_uninit_slice_mut ( ) ) } ;
44
45
let n = self . read ( read_to) . await ?;
45
46
if n != 0 {
46
47
unsafe {
@@ -246,7 +247,10 @@ impl Connector {
246
247
i += 1 ;
247
248
match self . connect ( endpoint, & mut deadline) . await {
248
249
Ok ( conn) => match conn. command_isro ( ) . await {
249
- Ok ( true ) => return Some ( unsafe { std:: mem:: transmute ( endpoint) } ) ,
250
+ // Safety: https://github.com/rust-lang/rust/issues/74068
251
+ Ok ( true ) => {
252
+ return Some ( unsafe { std:: mem:: transmute :: < EndpointRef < ' _ > , EndpointRef < ' _ > > ( endpoint) } )
253
+ } ,
250
254
Ok ( false ) => trace ! ( "succeeds to contact readonly {}" , endpoint) ,
251
255
Err ( err) => trace ! ( %err, r#"fails to complete "isro" to {}"# , endpoint) ,
252
256
} ,
Original file line number Diff line number Diff line change @@ -18,8 +18,12 @@ pub struct MarshalledRequest(pub Vec<u8>);
18
18
#[ derive( Clone , Copy , Debug ) ]
19
19
pub enum OpStat < ' a > {
20
20
None ,
21
+ #[ allow( dead_code) ]
21
22
Path ( & ' a str ) ,
22
- Watch { path : & ' a str , mode : WatchMode } ,
23
+ Watch {
24
+ path : & ' a str ,
25
+ mode : WatchMode ,
26
+ } ,
23
27
}
24
28
25
29
impl MarshalledRequest {
You can’t perform that action at this time.
0 commit comments