input: Write a python function to read data from a csv file and convert each row into a dictionary with keys 'name', 'age', and 'location', and return a list of these dictionaries.
  assert read_csv_to_dicts('data.csv') == [{'name': 'John', 'age': '30', 'location': 'New York'}, {'name': 'Jane', 'age': '25', 'location': 'Los Angeles'}]
  assert read_csv_to_dicts('empty.csv') == []
  assert read_csv_to_dicts('single_row.csv') == [{'name': 'Alice', 'age': '22', 'location': 'Chicago'}]
output: def read_csv_to_dicts(filename):
      import csv
  
      result = []
      with open(filename, newline='') as csvfile:
          reader = csv.DictReader(csvfile, fieldnames=['name', 'age', 'location'])
          for row in reader:
              result.append(row)
      return result