Since all the strings returned are static, you could return type &'static str and then remove the calls to to_string(). This avoids allocating a String. But if you need a String, that's fine too.
If you continue to return a String you could call to_string only once like this, to make it a little cleaner to read (this is just my preference):
let str = match SystemTime::now().duration_since(modified) {
Ok(file_age) => {
if file_age.as_secs() < 86400
/* 24h in seconds */
{
println!("Match green color: {:?}", file_age);
"green"
//return Ok(());
} else if file_age.as_secs() > 1728000
&& file_age.as_secs() < 3456000
/* 20 days in seconds */
{
"yellow"
} else if file_age.as_secs() > 3456000
/* 40 days in seconds */
{
"#00FFFF"
} else {
"white"
}
}
Err(_) => "white",
};
str.to_string()