// Risk of crashing if divisor is zero let avg = total / count;
// Explicitly check for zero divisor before division if count == 0 { return Err(ProgramError::InvalidArgument); } let avg = total / count;
Last updated 11 days ago