a_star: don't crash on deserialization errors and limit static types
[nit.git] / lib / mpd.nit
index e814b56..b0d25d8 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Client for a MPD server
+# Music Player Daemon client library
 module mpd
 
 import socket
@@ -130,7 +130,7 @@ class MPDConnection
                        var vol = status.volume
                        if vol != null then
                                var new_vol = vol + diff
-                               new_vol = new_vol.max(0).min(100)
+                               new_vol = new_vol.clamp(0, 100)
                                volume = new_vol
                                return
                        end