def rename_edge_attribute(topology, old_attr, new_attr):
    """Rename all edges attributes with a specific name to a new name

    Parameters
    ----------
    topology : Topology
        The topology object
    old_attr : any hashable type
        Old attribute name
    new_attr : any hashable type
        New attribute name

    Example
    -------
    >>> import fnss
    >>> topo = fnss.Topology()
    >>> topo.add_edge(1, 2, cost=1)
    >>> topo.add_edge(2, 3, cost=2)
    >>> topo.edges(data=True)
    [(1, 2, {'cost': 1}), (2, 3, {'cost': 2})]
    >>> fnss.rename_edge_attribute(topo, 'cost', 'weight')
    >>> topo.edges(data=True)
    [(1, 2, {'weight': 1}), (2, 3, {'weight': 2})]
    """
    for u, v in topology.edges():
        if old_attr in topology.adj[u][v]:
            topology.adj[u][v][new_attr] = topology.edge[u][v][old_attr]
            del topology.adj[u][v][old_attr]
