From 69555fe1f5c6bf555b1b4514eb7123aa092e5898 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Wed, 9 Dec 2020 15:21:05 +0100 Subject: [PATCH] Remove deprecated Time::Span.new variants (#10051) --- spec/std/time/span_spec.cr | 13 ------------- src/time/span.cr | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/spec/std/time/span_spec.cr b/spec/std/time/span_spec.cr index d6743ec2fa87..60e99a7facb9 100644 --- a/spec/std/time/span_spec.cr +++ b/spec/std/time/span_spec.cr @@ -31,14 +31,6 @@ describe Time::Span do t1 = Time::Span.new hours: 25 t1.to_s.should eq("1.01:00:00") - - t1 = Time::Span.new(1, 2, 3) - t1.to_s.should eq("01:02:03") - typeof(t1).should eq(Time::Span) - - t1 = Time::Span.new(1, 2, 3, 4, 5) - t1.to_s.should eq("1.02:03:04.000000005") - typeof(t1).should eq(Time::Span) end it "initializes with big seconds value" do @@ -46,11 +38,6 @@ describe Time::Span do t.total_seconds.should eq(1231231231231) end - it "initialize deprecated constructors" do - t = Time::Span.new(0, 0, 0, 0, nanoseconds: 1) - t.total_nanoseconds.should eq(1) - end - it "days overflows" do expect_overflow do days = 106751991167301 diff --git a/src/time/span.cr b/src/time/span.cr index 20592d5afabf..620fafd4354b 100644 --- a/src/time/span.cr +++ b/src/time/span.cr @@ -53,19 +53,6 @@ struct Time::Span # @nanoseconds can either be negative or positive). @nanoseconds : Int32 - @[Deprecated("Use `new` with named arguments instead.")] - def self.new(_hours : Int, _minutes : Int, _seconds : Int) - new(0, _hours, _minutes, _seconds) - end - - @[Deprecated("Use `new` with named arguments instead.")] - def self.new(_days : Int, _hours : Int, _minutes : Int, _seconds : Int, nanoseconds : Int = 0) - new( - seconds: compute_seconds(_days, _hours, _minutes, _seconds), - nanoseconds: nanoseconds.to_i64, - ) - end - # Creates a new `Time::Span` from *seconds* and *nanoseconds*. # # Nanoseconds get normalized in the range of `0...1_000_000_000`,