Vector3 Distance Incompatibility

Hi!
Whilst writing code for a Melee system for my game I came across an error that I can’t fix.
The error is as follows:
"The Best overload for the method ‘UnityEngine.Vector3.Distance(UnityEngine.Vector3, UnityEngine.Vector3)’ is not compatible with the argument list ‘(UnityEngine.Vector3)’."7

My code on the line of complaint:
var dist = Vector3.Distance(hit.transform.position - transform.position);

Correct code to do this is

var dist = Vector3.Distance(hit.transform.position, transform.position);

You can also use

var dist = (hit.transform.position, transform.position).magnitude;