Skip to content

Commit 13eccfd

Browse files
committed
pass
1 parent 6bd020a commit 13eccfd

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/sys/mod.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -141,27 +141,11 @@ unsafe fn tsk_column_access<
141141
tsk_column_access_detail(row, column, column_length).map(|v| v.into())
142142
}
143143

144-
/// # SAFETY
145-
///
146-
/// The safety requirements here are a bit fiddly.
147-
///
148-
/// The hard case is when the columns contain data:
149-
///
150-
/// * column and offset must both not be NULL
151-
/// * column_length and offset_length must both be
152-
/// the correct lengths for the input pointers
153-
/// * we return None if row < 0 or row > array length.
154-
/// * Thus, the requirement is that the two _lengths
155-
/// == 0 or (pointer both not NULL and the lengths are correct)
156-
///
157-
/// When the lengths of each column are 0, we
158-
/// don't worry about anything else
159144
fn tsk_ragged_column_access_detail<'a, T>(
160145
row: usize,
161146
column: &'a [T],
162147
raw_offset: &'a [bindings::tsk_size_t],
163148
) -> Option<&'a [T]> {
164-
//if row < 0 || row as bindings::tsk_size_t > column_length || raw_offset.is_empty(){
165149
if row >= raw_offset.len() || raw_offset.is_empty() {
166150
None
167151
} else {
@@ -179,9 +163,6 @@ fn tsk_ragged_column_access_detail<'a, T>(
179163
}
180164
}
181165

182-
// SAFETY: see tsk_ragged_column_access_detail
183-
// We further erquire that a pointer to a T can
184-
// be safely cast to a pointer to an O.
185166
fn tsk_ragged_column_access<'a, O, R: Into<bindings::tsk_id_t>>(
186167
row: R,
187168
column: &'a [O],
@@ -190,12 +171,6 @@ fn tsk_ragged_column_access<'a, O, R: Into<bindings::tsk_id_t>>(
190171
let row = row.into();
191172
let row = usize::try_from(row).ok()?;
192173
tsk_ragged_column_access_detail(row, column, raw_offset)
193-
//unsafe {
194-
// tsk_ragged_column_access_detail(row, column, column_length, offset, offset_length)
195-
// // If the safety requirements of tsk_ragged_column_access_detail are upheld,
196-
// // then we have received a valid pointer + length from which to make a slice
197-
// .map(|(p, n)| std::slice::from_raw_parts(p.cast::<O>(), n))
198-
//}
199174
}
200175

201176
/// # SAFETY

0 commit comments

Comments
 (0)