Skip to content

Commit 67fbc43

Browse files
authored
Merge pull request apache#16 from dahlbaek/forbid-unsafe
Forbid unsafe code
2 parents e5caac3 + d4efe0a commit 67fbc43

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

sdks/rust/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19+
#![forbid(unsafe_code)]
20+
1921
pub mod coders;
2022
pub mod elem_types;
2123
pub mod internals;

sdks/rust/src/worker/operators.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,12 @@ impl OperatorI for RecordingOperator {
411411
}
412412

413413
fn process(&self, value: DynamicWindowedValue) {
414-
unsafe {
415-
let mut log = RECORDING_OPERATOR_LOGS.lock().unwrap();
416-
log.push(format!(
417-
"{}.process({:?})",
418-
self.transform_id,
419-
value.downcast_ref::<String>().value
420-
));
421-
}
414+
let mut log = RECORDING_OPERATOR_LOGS.lock().unwrap();
415+
log.push(format!(
416+
"{}.process({:?})",
417+
self.transform_id,
418+
value.downcast_ref::<String>().value
419+
));
422420

423421
for rec in self.receivers.iter() {
424422
rec.receive(value);

0 commit comments

Comments
 (0)