This commit is contained in:
60
tests/fixtures/sample.rs
vendored
Normal file
60
tests/fixtures/sample.rs
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// This is a Rust file with various TODO/FIXME comments
|
||||||
|
|
||||||
|
fn calculate_sum(a: i32, b: i32) -> i32 {
|
||||||
|
// TODO: Implement proper error handling
|
||||||
|
a + b
|
||||||
|
}
|
||||||
|
|
||||||
|
fn process_data(data: &[u8]) -> Result<(), String> {
|
||||||
|
// FIXME: This function has a bug with empty data
|
||||||
|
if data.is_empty() {
|
||||||
|
return Err("No data provided".to_string());
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn complex_function(x: i32) -> i32 {
|
||||||
|
// HACK: This is a workaround for a dependency issue
|
||||||
|
// TODO: Refactor this when the library is updated
|
||||||
|
x * 2 + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fn another_function() {
|
||||||
|
// NOTE: This function is deprecated
|
||||||
|
// TODO: Remove in next version
|
||||||
|
println!("This is deprecated");
|
||||||
|
}
|
||||||
|
|
||||||
|
struct User {
|
||||||
|
id: u32,
|
||||||
|
name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl User {
|
||||||
|
fn new(id: u32, name: String) -> Self {
|
||||||
|
// FIXME: Validation is missing here!
|
||||||
|
Self { id, name }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// XXX: This is a critical issue that needs immediate attention
|
||||||
|
fn critical_function() {
|
||||||
|
// BUG: Memory leak detected here
|
||||||
|
let _data = vec![1, 2, 3];
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Implement unit tests for this module
|
||||||
|
// TODO: Add documentation comments
|
||||||
|
|
||||||
|
fn temp_impl() {
|
||||||
|
// TEMP: Quick fix for release
|
||||||
|
println!("temp");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn refactor_needed() {
|
||||||
|
// REFACTOR: This code is hard to maintain
|
||||||
|
let x = 1;
|
||||||
|
let y = 2;
|
||||||
|
let z = 3;
|
||||||
|
println!("{} {} {}", x, y, z);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user