You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 0695-max-area-of-island.rs
    path of file: ./repos/NeetCode-Solutions/11_Graphs/03_Max_Area_of_Island
    
    the code of the file until where you have to start completion: /*
Problem: LeetCode 695 - Max Area of Island

Key Idea:
The key idea is to use depth-first search (DFS) to traverse the grid and identify connected islands. We maintain a count of the area of each island and keep track of the maximum area encountered.

Approach:
1. We can approach this problem using depth-first search (DFS).
2. Initialize a variable `max_area` to 0 to keep track of the maximum area of an island.
3. Iterate through the grid cel
    
    fn dfs(grid: &mut Vec<Vec<i32>>, i: usize, j: usize) -> i32 {
        let rows = grid.len();
        let cols = grid[0].len();

        if i >= rows || j >= cols || grid[i][j] == 0 {
            return 0;
        }

        grid[i][j] = 0; // Mark as visited

        // Explore neighbors in all four directions
        let directions = [(0, 1), (0, -1), (1, 0), (-1, 0)];
        let mut area = 1;

        for (dx, dy) in directions.iter() {
            let x = (i as isize + dx) as usize;
            let y = (j as isize + dy) as usize;
            area += Solution::dfs(grid, x, y);
        }

        area
    }