How did tiny San Marino maintain its independence when the rest of Italy was being unified during the Italian Wars of Unification?

by should-stop-posting
Assorted_Bits